Forum Moderators: phranque
I'm trying to forward all requests for non-exisiting pages/directories to mypage.php. This, in order to allow virtual directories like mydomain.com/animals/cats even though /animals/cats does not exist.
I got the following code :
Options +FollowSymLinks
RewriteEngine on
rewritecond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}!-f
rewritecond %{DOCUMENT_ROOT}%{REQUEST_FILENAME}!-d
RewriteRule . /mypage.php
(I was told this is better than using ErrorDocument)
It works a bit too well. Now EVERYTHING is sent to mypage.php, even though if i try to access a file or directory which exists.
Please advice!
markus
Options +FollowSymLinks
RewriteEngine on
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mypage.php [L]