I hope you can help. I'm trying to write a htaccess file do the following.
1) redirect to www. address
2) remove .php from url
3) If the file doesn't exist then use filechecker.php?page=filename
1 I can do with
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
2) I can do with
RewriteCond %{SCRIPT_FILENAME}.php -f
RewriteRule [^/]$ %{REQUEST_URI}.php [QSA,L]
3) I thought
RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteRule ^([^/]*)$ filechecker.php?page=$1 [QSA,L]
would work, but for some reason it is ignoring the fact that the page does actually exist.
I hope you can help Mark
Your solution for 2 will loop, but simple enough to fix, stick something along the following lines in your file for part 2 and 3:
FYI: The Apache mod_rewrite documentation is worth a read, if your unclear as to what the above rules do, or if you want something a little more abstract consider the following post.