1

Google accesses my site via my DNS reverse records e.g. static-myip.host.com instead of using the domain

In Google Webmaster tools I get DNS issues - could it be that allowing Google to access a site via reverse records is not the best thing? How can I redirect direct accesses via reverse records to the actual domain?

  • I'm pretty sure that you can redirect these accesses via httpd.conf, but I have no clue how and the documentation on this issue is small – mashup Sep 16 '11 at 20:27
  • I don't suppose it's as easy as getting your reverse DNS to match your forward DNS? – Alo Sep 16 '11 at 20:47
3

You can create a new name-based virtual host matching your reverse hostname and redirect it with 301 to the correct domain (e.g. example.net):

<VirtualHost *:80>
    ServerName static-myip.host.com
    DocumentRoot /var/www

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule (.*) http://example.net/$1 [R=301,L] 
    </IfModule>
</VirtualHost>

This way Google bots will know that the real URL for the content is http://example.net/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.