Hello people, this is my first time in Github and I’ve been stuck in something for a few days now.
I’m trying to make my website more dynamic and render my contents via ajax and js pushState. The thing is, it does work fine actually, no page refresh at all. The problem is that when I refresh the page, the browser redirects me to the url provided by the pushState (obviously). The thing is that all the url’s load naked, meaning with no CSS or header, just plain html.
This is happening because I have all of my CSS files, scripts and my header included in my index.php, so when I use pushState and ajax to load contents I render those contents in the body of my index (whis has all of my website assets).
Also, if I write any of my website url’s directly into the browser address bar, It will be the same problem (obviously), because those urls don’t have any of the assets of my website, index is the only one containing them.
I’ve been currently working by passing parameters with GET requests and switching contents with php switch, so every “href” will be switching the previous content in my index.
Hope I made myswlf clear enough to get some help here, this is the last problem I need to solve to launch this website.