khalidmushtaq65 Posted August 19, 2010 Share Posted August 19, 2010 Hi, I am facing a problem in url rewriting, that is my case..... When I rewrite http://www.something.com/users to http://www.something.com/users.php It works fine.... It's that when I use one string after my server / domain name, it works fine..... But when rewriting something http://www.somethig.com/users/pakistan or http://www.something.com/users/pakistan/lahore to http://www.something/users.php?country=pakistan or http://www.something/users.php?country=pakistan&city=lahore respectively, the css of the respective page doesn't apply on that page.... In short, one string is working, more than one disable the css of the page.... I hope you will help me... Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/211199-css-problem-in-url-rewriting/ Share on other sites More sharing options...
wildteen88 Posted August 19, 2010 Share Posted August 19, 2010 Add a / in front of the styles sheets file name, eg <link rel="stylesheet" type="text/css" href="/stylesheet.css" /> Now it will always load from the root of your url, eg http://www.somethig.com/stylesheet.css. Otherwise the browser is thinking you're within a directory and is loading the css file in http://www.somethig.com/users/ or http://www.somethig.com/users/pakistan/ Quote Link to comment https://forums.phpfreaks.com/topic/211199-css-problem-in-url-rewriting/#findComment-1101312 Share on other sites More sharing options...
khalidmushtaq65 Posted August 19, 2010 Author Share Posted August 19, 2010 Thanks wildteen8, it's still not working.... Quote Link to comment https://forums.phpfreaks.com/topic/211199-css-problem-in-url-rewriting/#findComment-1101316 Share on other sites More sharing options...
wildteen88 Posted August 19, 2010 Share Posted August 19, 2010 You will also want to add these lines to your .htaccess file before your rewrite rules RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d That should make mod rewrite ignore existing files/folders Quote Link to comment https://forums.phpfreaks.com/topic/211199-css-problem-in-url-rewriting/#findComment-1101324 Share on other sites More sharing options...
khalidmushtaq65 Posted August 19, 2010 Author Share Posted August 19, 2010 CSS Problem is fixed now... Now another problem has occured... When I click on a link i.e. http://localhost/ecommerce/smartadmin/dashboard/pages/6 and then hover a mouse on another link it will add 'pages/' to that link... something like that. http://localhost/ecommerce/smartadmin/dashboard/pages/customer/list Can you help me in fixing this? Thanks...... Quote Link to comment https://forums.phpfreaks.com/topic/211199-css-problem-in-url-rewriting/#findComment-1101365 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.