You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by joshua hough <jo...@openc.k12.or.us> on 2005/03/23 22:12:29 UTC

[users@httpd] mod_rewrite everything but one file?

I am new to mod_rewrite and want to set up my first rule to redirect all 
requests to another domain -- except for the file "robots.txt" in the root. 
Extensive research has not helped me compose an adequate rule.
Thanks in advance,
Josh


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite everything but one file?

Posted by Rich Bowen <rb...@rcbowen.com>.
joshua hough wrote:
> I am new to mod_rewrite and want to set up my first rule to redirect all
> requests to another domain -- except for the file "robots.txt" in the
> root. Extensive research has not helped me compose an adequate rule.
> Thanks in advance,

Prefix your rewrite rules with

RewriteCond %{REQUEST_URI} !^/robots.txt

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org