【发布时间】:2014-08-03 19:01:47
【问题描述】:
我有很多域(www.vf1.com、www.vf2.com、www.vf3.com 等)都指向我的主域(www.vf.com)。如何从这些其他域执行 301 重定向到我的主域?
因此,如果有人点击 www.vf1.com/news/1234,他们应该被重定向到 www.vf.com/news/1234
我还有不需要重定向的域,例如 images.vf.com、css.vf.com 和 js.vf.com
我在 IIS 上使用 ColdFusion 8(但我目前无法访问 IIS)
我在 http://www.festivalreviews.co.uk/latest/news/14500 等 URL 上尝试了以下操作,但它被重定向到 http://www.virtualfestivals.com/index.cfm
<cfif cgi.http_host IS 'www.festivalreviews.co.uk'>
<cfset jjURL = 'http://www.virtualfestivals.com' & CGI.PATH_INFO>
<cfheader statuscode="301" statustext="Moved Permanently">
<cfheader name="Location" value="#jjURL#">
</cfif>
谢谢
【问题讨论】:
-
我倾向于在 HTTP 服务器上处理诸如重定向之类的 HTTP 内容,而不是通过 CF。
标签: iis coldfusion http-status-code-301 coldfusion-8 cflocation