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

Bluehost - Forward Subdomain with masking

· 52CE 我爱测

I forwarded a Bluehost subdomain to my home server's IP address. When I enter the subdomain in my browser's address bar, it redirects fine, but it shows the numerical IP address and not the subdomain name. I forwarded a domain in…

问题原文

原帖链接 · Jeff Matthews · CC BY-SA 4.0

I forwarded a Bluehost subdomain to my home server's IP address. When I enter the subdomain in my browser's address bar, it redirects fine, but it shows the numerical IP address and not the subdomain name.

I forwarded a domain in Godaddy this way, and they offered a checkbox to forward with masking. Masking works.

I don't see a masking option with Bluehost. Is there a way to do this?

已采纳解答

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

it redirects fine, but it shows the numerical IP address and not the subdomain name.

It's not a "redirect" that you want (at least, not if you want to do this "properly"). You should configure your subdomain as an A record in DNS that points to your "home server's IP address".

You must then configure your home server to accept requests for this subdomain. (Probably through a ServerName or ServerAlias directive in a <VirtualHost> on your home (web) server.)

and they offered a checkbox to forward with masking. Masking works.

I believe Godaddy's "masking" just uses a frame (or iframe) to literally "hide" the target URL from the browser's address bar. This has a number of drawbacks:

  • The URL in the address bar does not change as the user navigates the site. Pages are therefore impossible to bookmark or share.
  • The URL in the frame (ie. the target IP address) is the one that will be crawled by bots. So, the IP address will be indexed, not the subdomain used as the "forward".

This might be OK in some casual situations, but most of the time it's not (for the reasons mentioned above) - it is a last resort.

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

资料来源与适用范围

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

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

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