I am trying to setup my URL rewrites to check for a certain template and if it doesnt exist use a default one
So if I have a URL:
http://www.mysite.co.uk/feed/
I want it to check if feed.php exists and use that if it does, but if it doesn’t to use page.php?page=feed instead
This is what I currently have:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^([^/.]+)/$ $1.php
RewriteRule ^([^/.]+)/$ page.php?page=$1 [L]
ErrorDocument 404 /404.php
It works fine if feed.php exists, but when it doesn’t it defaults straight to my custom 404.php and bypasses the second rewrite rule
I know it I need some kind of RewriteCondition but I dont know enough about it and cant find a pertinent example
Any help would be much appreciated! =D
Try this :