Google has indexed my clients IP address rather than the domain, so now I'm messing with setting up a 301 redirect in my .htaccess file to redirect the IP address and all subsequent pages to the domain. I currently have something like this in place: RewriteCond %{HTTP_HOST} ^12\.34\.567\.890 RewriteRule (.*) http://domain.com/$1 [R=301,L] I've used various redirect checker tools and keep getting the message: "... not redirecting to any URL or the redirect is NOT SEARCH ENGINE FRIENDLY" which leads me to believe the redirect isn't working. Am I doing something wrong or should I be trying a different method? Thanks! Alice
Try with the following code: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^121\.121\.11\.121 RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L] Code (markup):
I think you should use Redirect permanent /(.*) hxxp://domain.com/$1 for that. I am not sure if it is going to work with (.*) and $1 as i have only used it as Redirect permanent / hxxp://domain.com/