This is my .htaccess
. It redirects /contact
to index.php?page=contact
This works perfectly. But with this .htaccess
, if someone puts /contact.php
, they'll get an error.
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !index\.php [NC]
RewriteRule ^([^/]+)/?$ index.php?page=$1 [QSA]
Basically, is there any way to only rewrite if there's no .php
in the URL?
If there's a .php
in the URL, e.g. contact.php
just load the normal .php
page.
How could I do this?