如果我有两个域名:
altcognito.com
假设我有另一个下面的域名:
alt-cognito.com
什么是“最好的”重定向(我要使用永久重定向吗?)我想建议altcognito.com是一个“正确”的网站。
(当然,这些只是示例)
发布于 2009-05-03 12:28:59
如果你想说“你应该总是去foo而不是bar”,你想要一个301重定向(这是你的前端服务器做的)。请参阅http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=93633
302 (临时)重定向应该用在你不能为页面提供服务的情况下,但希望它稍后会回来。不幸的是,它是从JSP转发得到的重定向。
应尽可能避免客户端(meta refresh或javascript)重定向。
Edit per comment:这里有一个指向Apache文档的链接,用于配置永久(或临时)重定向:http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
发布于 2009-05-03 12:36:35
<VirtualHost *:80>
ServerAlias altcognito.com
ServerAlias alt-cognito.com
ServerAlias www.alt-cognito.com
RedirectMatch permanent ^/(.*) http://www.altcognito.com/$1
</VirtualHost>这3个域名(www和非www)将301重定向到您的主域www.altcognito.com
https://stackoverflow.com/questions/816924
复制相似问题