tags:

views:

113

answers:

3

Hello,

I have a .htaccess file which arranges that all requests go through index.php. Now i would like to make an exception for rss.php. to go straight throuh rss.php. How do I do this?

This is how it looks like now:

RewriteEngine on
RewriteBase /
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php

Thanks.

+5  A: 

Put this before the last line.

RewriteCond %{REQUEST_URI} !^/rss\.php$
Ian Roke
+4  A: 

You can exclude any existing file with an additional RewriteCond directive:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Gumbo
I got slated yesterday for posting an answer that didn't answer the question. Sanders specifically asked to route all requests to index.php except for rss.php.
Ian Roke
the same if used on wordpress, thanks for the point.
Mike
A: 

Or alternatively do a rewrite that matches the file then skips the rest of the rewrite tests.

By putting the following line before your existing RewriteRule will redirect without going through index.php.

RewriteRule  ^/rss.php  /rss.php  [L]

I came across this page while hunting for a way to do this with my /robots.txt file.

mod_rewrite with apache1.3

CoffeeMonster