301 redirection
Posted: Mon Dec 28, 2009 11:23 pm
Hello Friends.. how r u all? Ahsan here.. am a newbie to PHP... I am stuck in a problem and I think this is the best platform for discussing issues related to PHP and getting quality solutions..Okay now lets talk about the issue.. I have a website of which i changed the domain name recently.. so now I want all my website visitors, that are requesting a particular page (or the index page) on the old domain, to be redirected (permanently i.e. with 301 header) to the corresponding page on the new domain but with the lower case i.e http://www.olddomain.com/AHSAN/ is redirected to http://www.newdomain.com/ahsan/. In addition to this, I also want to have my old domain in Google webmaster tools i.e. to verify the ownership of my old domain. Now what I did is that I made a .htaccess file as follows :
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
The redirection is working fine but the script is not lowering the case of the URL i.e. http://www.olddomain.com/AHSAN/ is redirected to http://www.newdomain.com/AHSAN/ instead of http://www.newdomain.com/ahsan/ and also Google is not able to verify the ownership of mine for my old domain.. Here I want to mention that I am verifying my website through the "uploading file" method so when google tries to access that file on the old domain it is redirected to the new domain. I hope I am clear with my query.. If I am not, please let me know.. Hope to get the solution soon.
Regards
Ahsan
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
The redirection is working fine but the script is not lowering the case of the URL i.e. http://www.olddomain.com/AHSAN/ is redirected to http://www.newdomain.com/AHSAN/ instead of http://www.newdomain.com/ahsan/ and also Google is not able to verify the ownership of mine for my old domain.. Here I want to mention that I am verifying my website through the "uploading file" method so when google tries to access that file on the old domain it is redirected to the new domain. I hope I am clear with my query.. If I am not, please let me know.. Hope to get the solution soon.
Regards
Ahsan