本站使用的是Win主机,所以是通过对web.comfig进行了301重定向
|
|
本站使用的是Win主机,所以是通过对web.comfig进行了301重定向
代码如下:
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^webwe6.com$" />
</conditions>
<action type="Redirect" url="http://www.webwe6.com/{R:0}"
redirectType="Permanent" />
</rule>
复制代码
至于Apache服务器的.htaccess实现301重定向可参考以下修改方法,未经测试,请修改前备份!
RewriteEngine on
RewriteCond %{http_host} ^webwe6.com [NC]
RewriteRule ^(.*)$ http://www.webwe6.com/$1 [L,R=301]
复制代码
IIS服务器实现301重定向:
用ASP/PHP实现301重定向:
ASP:
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://www.webwe6.com/”
Response.End
复制代码
PHP:
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location:http://www.webwe6.com/”);
exit();
复制代码 |
|
|
|
|
|
|
|
|