隐藏子域
我在子域上有一个网站,并且想隐藏它是子域的事实。我怎样才能这样做呢?
例如,该网站是 www.example.com,它是 www.mydomain.com 的子域。我不想让人们知道 example.mydomain.com 与 www.example.com 相同。我该如何隐藏这个?与.htaccess?如何?
谢谢!!
I have a website on a subdomain, and would like to hide the fact that it's a sub-domain. How can I do so?
For example, the site is www.example.com, and it's a sub-domain of www.mydomain.com. I don't want people to know that example.mydomain.com is the same as www.example.com. How do I hide this? With .htaccess? How?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
www.example.com 不可能是 www.mydomain.com 的子域。我认为你的意思是它们指向相同的 IP 地址,因此它们指向相同的网站(或者存在某种重定向)。
域名很简单,example.com 或 mydomain.com。这些域的子域示例为:www.example.com、mobile.example.com、whatever.mydomain.com 并且它们可以或不可以指向域根。
我将向您展示一个示例:
Google App Engine 让您选择一个 appspot.com 子域,例如 myapp.appspot.com。如果您调用此子域,您将访问您的网站。但人们通常希望使用自己的域或子域,例如 myapp.mydomain.com。两个子域将返回相同的内容。如果您希望停用 appspot.com 子域,可以按照此解决方案操作。
www.example.com is impossible to be a sub-domain of www.mydomain.com. I think you mean they point to the same IP address and, therefore, they point to the same website (or there are some kind of redirect).
A domain is simply, example.com or mydomain.com. Examples of sub-domains of these domains are: www.example.com, mobile.example.com, whatever.mydomain.com and they could, or not, point to the domain root.
I'll present you an example:
Google App Engine let's you chose a appspot.com subdomain, for instance, myapp.appspot.com. If you call this subdomain you access your website. But people usually want to use their own domain, or a subdomain, for instance, myapp.mydomain.com. Both subdomains will return the same content. If you'd wish to disable the appspot.com subdomain, you may follow this solution.
您可以使用“proxy|P”(强制代理)标志。
阅读手册 http://httpd.apache.org/docs/2.0/mod/ mod_rewrite.html
注意:必须启用 mod_proxy 才能使用此标志。
You could use the 'proxy|P' (force proxy) flag.
Read the manual http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
Note: mod_proxy must be enabled in order to use this flag.