Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

up vote 3 down vote accepted

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/

share|improve this answer
    
Thanks, exactly what I was looking for –  mashup Sep 16 '11 at 22:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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