Forum Moderators: phranque
RewriteRule ^robots\.txt$ - [L]
It says, "If robots.txt is requested, leave the URL unchanged and stop processing mod_rewrite directives." The result is that no further RewriteRules are processed when robots.txt is requested -- mod_rewrite quits, and the file is served.
I use the same approach to allow universal access to robots.txt and my custom 403-Forbidden error page.
Jim
# Block IPs from accessing all but robots.txt and custom 403 page
SetEnvIf Request_URI "(403\.html¦robots\.txt)$" alw
<Files *>
Order Deny,Allow
Deny from 192.168.0.1
Deny from 127.0.0.3
Allow from env=alw
</Files>
Jim