Mobile app version of vmapp.org
Login or Join
Ravi8258870

: How to redirect IP to domain? My IP xxx.xxx.xxx.xx is pointing to example.com at GoDaddy but I just noticed that when I type the IP in browser, it doesn't redirect to the website, how can

@Ravi8258870

Posted in: #Apache #DuplicateContent #Htaccess #HttpdConf #Redirects

My IP xxx.xxx.xxx.xx is pointing to example.com at GoDaddy but I just noticed that when I type the IP in browser, it doesn't redirect to the website, how can do this? I am sure this will happen through httpd.conf but unsure about what I need to add.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ravi8258870

1 Comments

Sorted by latest first Latest Oldest Best

 

@Turnbaugh106

You can use the .htaccess file to redirect from IP to domain using this code:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^555.555.555.555
RewriteRule (.*) www.example.com/ [R=301,L]


Change 555.555.555.555 to match the IP of your server, additionally though you can use canonical urls that will prevent duplicates entering Googles index, Check out: Should I redirect the site IP address to the domain name.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme