I am changing my website's address to a new domain, and I want to use mod_rewrite to redirect all trafict from the old address to the new one.
.htaccess at the old address ( domain.com ) is:
--------------------------------------------
RewriteEngine on
RewriteBase /
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
--------------------------------------------
by what I understand it should transferr all url's to the new address ( domain.co.uk )
.htaccess at the NEW address ( domain.co.co.uk ) is:
-----------------------------------------
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk
RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
RewriteRule ^contact$ contact.php
RewriteRule ^about$ about.php
ErrorDocument 404 /404.php
----------------------------------------
the first part is to redirect to www address if the entered url is without www
second part is to make short url's contact and about and the last bit for errors
------ THE PROBLEM ------
when I try to access domain.com/about
it should redirect to www.domain.com/about
BUT FOR SOME reason it redirects to www.domain.com/about.php --- I don't want php to be there! :/
and for some reason it works ok for domain.com/contact - it redirects to www.domain.com/contact
can you help me with it please?