kusanagi
kusanagi

Reputation: 14614

mapping non exist file

if robots.txt non exist it mupping on robots.php, but if exist -return robots.txt

RewriteEngine on
    RewriteCond %{robots.txt} !-f [NC]
    RewriteRule robots.txt robots.php [L] 

this code always return robots.php

Upvotes: 0

Views: 66

Answers (1)

David Fells
David Fells

Reputation: 6798

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^/robots\.txt/$ robots.php [L]

Think that's what you need...

Upvotes: 2

Related Questions