ShaolinF Posted October 16, 2007 Share Posted October 16, 2007 Hi Guys, I was on my site when I decided to add a forward slash at the end of my index page and all the css dissapeared. Does anyone know why this happens and how one can resolve it ? Quote Link to comment Share on other sites More sharing options...
derwert Posted October 21, 2007 Share Posted October 21, 2007 Are you using any $_SERVER variables in the code? Quote Link to comment Share on other sites More sharing options...
ShaolinF Posted October 21, 2007 Author Share Posted October 21, 2007 Well Im using $_SESSION if thats a server variable.. Quote Link to comment Share on other sites More sharing options...
derwert Posted October 21, 2007 Share Posted October 21, 2007 You haven't provided any information other than your problem, code perhaps? Since I'm not going to try to guess anymore add this to the top of your script. if(isset($_SERVER['PATH_INFO'])){ header('Location: http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['SCRIPT_NAME']); exit(); } Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted October 22, 2007 Share Posted October 22, 2007 Are you using clean URLs? If so, then use absolute paths to your CSS files. E.g. CSS file is at /stylesheets/default.css (referenced as stylesheets/default.css in a link tag) URL (before): http://example.com/articles - link tag points to http://example.com/stylesheets/default.css URL (new): http://example.com/articles/ - link tag points to http://example.com/articles/stylesheets/default.css (doesn't exist) I hope you understand my example. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.