Mobile app version of vmapp.org
Login or Join
Gonzalez347

: What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names? I plan to have 2 separate domain names pointing to the same Apache installation

@Gonzalez347

Posted in: #Apache #Seo #Virtualhost #Wordpress

I plan to have 2 separate domain names pointing to the same Apache installation with WordPress multi-site.

I can set virtual hosts correctly for each domain, no problems. I can have both domains point to the same host, no worries.

Currently I have a redirect for all traffic hitting the web server IP address to my initial domain:

<VirtualHost *:80>
<Directory "/share/Web/WordPress">
Options FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerName 1.1.1.100
Redirect / www.example.com/ </VirtualHost>


What is the best practice for redirecting the IP address when 2 domain names point to the same IP?

I thought about creating a generic 404 page and having that displayed when hitting the IP address. But would this hurt my SEO on both sites?

How do shared hosting companies redirect HTTP traffic based on an IP address? Do they point back to the parent company, or something else? Perhaps this is a non issue all together?

So just to be clear: what is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

2 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes151

The answer to your question "What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?" is this: Best practice is to use a redirect (Apache) or return an error 444 (Nginx) to prevent host header attacks.

Your second question about SEO is irrelevant and has nothing to do with the title of your question, but you should ask a new question "Can redirecting requests for a server's IP address influence SEO?" if it worries you.

Here is an example for Apache:

<VirtualHost *:80>
ServerName IP.AD.DR.ESS
Redirect permanent / www.example.com/ </VirtualHost>


And here is an example for Nginx:

server {
listen 80;
server_name IP.AD.DR.ESS;
return 444;
}


Both examples listen on port 80 only because redirecting HTTPS requests for the IP address on port 443 is not possible.

10% popularity Vote Up Vote Down


 

@Mendez628

The answer is in the comment:

Hosting companies that offer shared accounts typically have a number of sites hosted all on the same IP address using virtual hosts as you've done.. They point the IP address either to a default server page, default site, or an error page. In either case, that does not affect any other site SEO-wise.

For clarity redirecting the IP to an error page, 404 or another landing page is the best practice.
None of which will negatively affect SEO of any domain hosted.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme