大网数据广告活动
网站运营与故障问答

What is the best practice for redirecting the IP address of a web server when it hosts multiple domain names?

· 52CE 我爱测

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…

问题原文

原帖链接 · Mike · CC BY-SA 3.0

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 / https://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?

已采纳解答

原帖链接 · Mike · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。