Hi there. I have a website that has been indexed by Google by ip address. I have managed to redirect the ip address to the domain name using this code. RewriteCond %{HTTP_HOST} ^mydomain\.com [OR] RewriteCond %{HTTP_HOST} ^12\.131\.34\.247 RewriteRule (.*) http://www.mydomain.com/$1 [L,R=301] This works fine for the home page but I need to redirect the inner pages also. For e.g. I need to redirect: http://12.131.34.247/contact-us/ to http://www.mydomain.com/contact-us Can someone pls help!
Hi, You can use the following: RewriteCond %{HTTP_HOST} ^mydomain\.com [OR] RewriteCond %{HTTP_HOST} ^12\.131\.34\.247 RewriteRule ^/(.*)$ http://www.mydomain.com/$1 [L,R=301] The change is just RewriteRule ^/(.*) instead of RewriteRule (.*)$ Please try and let me know too!!! Thanks, Manoj Kumar