简体   繁体   English

网站上的CNAME网址已转移到

[英]CNAME url on site transfered to

Is it possible to have the site you transfer to from a CNAME and 'A' record keep the name from the CNAME in the url? 是否可以让您从CNAME转移到的网站和“ A”记录将来自CNAME的名称保留在URL中? Example: Site 123.com has a CNAME called app pointing to abc.com. 示例:站点123.com的CNAME名为app指向abc.com。 When I type in app.123.com, it transfers me to abc.com and keeps app.123.com in the url on the first page that I transfer to. 当我输入app.123.com时,它会将我转移到abc.com,并将app.123.com保留在我转移到的第一页的URL中。 But once I click anything on the page to move around within the page, the url reverts back to abc.com. 但是,一旦我单击页面上的任何内容在页面内四处移动,URL就会恢复为abc.com。 Is it possible to have the app.123.com stay in the url while I move around. 我四处走动时,是否有可能将app.123.com留在网址中。 So instead of changing to abc.com/otherPage.php, it would stay app.123.com/otherPage.php? 因此,与其更改为abc.com/otherPage.php,不如将其保留为app.123.com/otherPage.php?

Thanks for any help! 谢谢你的帮助!

There are two different mechanisms at work here, DNS and HTTP. 这里有两种不同的机制在起作用,DNS和HTTP。

When you use a URL containing app.123.com, that's looked up using DNS and gives the IP address that happens to be the same as the IP address configured for abc.com 当您使用包含app.123.com的URL时,将使用DNS查找该URL,并提供恰好与为abc.com配置的IP地址相同的IP地址。

But once you're viewing that page, the HTML of that page will determine how the links work, they may be absolute URLs including abc.com or they may be relative URLs, so behaviour could vary. 但是,一旦您查看了该页面,该页面的HTML就会确定链接的工作方式,它们可能是包括abc.com绝对URL,也可能是相对URL,因此行为可能会有所不同。

A site can be made to work under multiple aliases but it would need to use the request headers to detect the address used by the client and alter content accordingly. 可以使站点在多个别名下工作,但是它需要使用请求标头来检测客户端使用的地址并相应地更改内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM