NO CSS sheet or no formatted header

Oh, the strange things mod_rewrite does!

NO CSS sheet or no formatted header

Postby Denio » Wed Jun 18, 2008 11:32 am

What I have to do:
get two variables like:
xy.com/$1/$2/anytext.html
xy.com/$1/$2.html
xy.com/$1.html
All of these has to work so the header looks as above.

FILE:
Code: Select all
Options +FollowSymlinks
RewriteEngine on

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

RewriteCond %{REQUEST_URI} !images/(.*)\.
RewriteCond %{REQUEST_URI} !style.css
RewriteCond %{REMOTE_ADDR} !192.168.1.3

RewriteRule ^([^/]+).html? /index.php?action=$1 [NC,R,L]
RewriteRule ^([^/]+)/([^/]+).html? /index.php?action=$1&id=$2 [NC,R,L]
RewriteRule ^([^/]+)/([^/]+)/(.*).html? /index.php?action=$1&id=$2 [NC,R,L]


PROBLEM:
now it works (the CSS also) but the header gets back to /index.php?action=$1&id=$2
If I only put [NC] after each line, than the header looks ok (xy.com/variable/variable/user.html) but it looks like there is NO STYLE SHEET so the web page shows up as is.

I use this site with a sudomain directed to this test website's directory.

I am not a professional as you'd guess but I need help. Thank you in advance!
Denio
 
Posts: 2
Joined: Wed Jun 18, 2008 11:18 am

Postby Denio » Thu Jun 19, 2008 6:28 am

Problem solved.
Because of the "/" characters, the system thought that it is a directory so the style.css couldn't be found there. (looks as is)

Now I've replaced the "/" to "-" signs so it looks like this:
xy.com/action-id-anytext.html

Now it works and only the [NC] is needed.
Denio
 
Posts: 2
Joined: Wed Jun 18, 2008 11:18 am

Postby richardk » Thu Jun 19, 2008 1:21 pm

richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Idiosyncrasies

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron