Reputation: 10898
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.
Upvotes: 4
Views: 451
Reputation: 2190
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.
Upvotes: 0
Reputation: 655805
You can exclude any existing file with an additional RewriteCond
directive:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Upvotes: 4
Reputation: 1784
Put this before the last line.
RewriteCond %{REQUEST_URI} !^/rss\.php$
Upvotes: 6