I have all html of my site in index.php.
what I am doing is whenever someone clicks on blog button. I am using pushState to change the url and show/hide different section based on the url
history.pushState({}, '', '/blog/');
and on nginx server what I did is if any page reload happens load the index.php page.
so if someone reload the page from /blog/ at initial state the index page will load and on javascript I am handing the url like this
switch (window.location.pathname) {
case '/blog':
// show blog page
showSection(blogSection, 'Blog');
break;
everything works as expected if I remove the trailing slash when pushState(). But I need to keep the trailing slash. how can I achieve this?