怎么设置301重定向跳转

2024-10-12 01:31:51

1、Linux系统方法;首先新建文件.htaccess通过对他的设置,可以实现强大的功能,301重定向之一。Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^sousuoyx.com [NC] RewriteRule ^(.*)$ http://www.sousuoyx.com/$1 [L,R=301]

2、W坡纠课柩indows系统方法;新建文件web.config来实现301重定向<configuration>媪青怍牙<system.webServer><rewrite><rules><rule name="WWW Redirect" stopProcessing="true"><match url=".*" /><conditions><add input="{HTTP_HOST}" pattern="^$" /></conditions><action type="Redirect" url="sousuoyx.com{R:0}"redirectType="Permanent" /></rule></rules></rewrite></system.webServer></configuration>将此web.config上传到根目录即可,前提条件是:Windows主机的iis必须是7.0以上的

3、检测工具:我们可以利用站长工具

怎么设置301重定向跳转
猜你喜欢