PDA

View Full Version : mod_rewrite & browser issue


johnnyb
01-20-2007, 03:46 AM
Hi,

I have this line in my .htaccess file doing some rewriting. Here's the line:

RewriteRule ^([^/]*)?(/)?teach/?(.*)?$ admin/$3?sn=$1

What it does is, for example, when I go to mysite.com/frank/teach/index.php it rewrites to mysite.com/admin/index.php?sn=frank

It works great, except for one thing. When I go to mysite.com/frank/teach/ it works great, however when I go to mysite.com/frank/teach the stylesheet doesn't load properly. The stylesheet is at /admin/styles/screen.css and is called using a tag like this:
<link href="style/screen.css" rel="stylesheet" type="text/css" media="screen" />
I would think it would work but it doesn't. Does anyone have any ideas?

John

schleppel
01-21-2007, 06:45 PM
The path to the style sheet is relative to the path in the address bar of the browser, so it's looking for it at /frank/teach/style/screen.css. You'll either want to use /admin/styles/screen.css or ../../admin/styles/screen.css instead of style/screen.css.