apache 网站301跳转,apache301跳转



今天做了网站全站301跳转,把顶级域名qiuxue365.cn全站指向www.qiuxue365.cn;

.htaccess文件,301代码如下:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

	RewriteCond %{http_host} ^qiuxue365.cn [NC]
    RewriteRule ^(.*)$ http://www.qiuxue365.cn/$1 [L,R=301]
	
	RewriteRule ^(\S*)\/$ http://www.qiuxue365.cn/$1.html [L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

</IfModule>


在浏览器测试qiuxue365.cn,成功跳转www.qiuxue365.cn,返回信息如下:


相关内容

    暂无相关文章