Apache rewrite with many slash not working?

Posted by Daok on Stack Overflow See other posts from Stack Overflow or by Daok
Published on 2010-03-13T21:48:51Z Indexed on 2010/03/13 21:55 UTC
Read the original article Hit count: 317

Filed under:
|
|
|

I have modified a website with a redirection to a single page:

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

It works as it suppose to be. Everything is redirected to index.php. Here is a working example that display index.php with all images and css:

http://.....com/section1

The problem occur when I try :

http://....com/section1/subsection

The page is redirected to index.php, BUT no images, no css, no javascript. Inside the PHP script everything is like this directly linked to the images or css or javascript like:

<img src="images/images1.png> ... <img src="images2.png">

Why does url with many slash like .com../123/123/whatever does not work with images, css or javascript when .com/no_slash_url works?

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite