Jump to content

CSS Problem in URL Rewriting


khalidmushtaq65

Recommended Posts

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.

 

Add a / in front of the styles sheets file name, eg

<link rel="stylesheet" type="text/css" href="/https/forums.phpfreaks.com/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/

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

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......

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.