apache 网站301跳转

来源:互联网 发布:如何编程游戏的代码 编辑:程序博客网 时间:2024/06/05 19:44


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

.htaccess文件,301代码如下:

<IfModule mod_rewrite.c>    Options +FollowSymlinks    RewriteEngine OnRewriteCond %{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,返回信息如下:


原创粉丝点击