www.aaa.com/index.html跳转www.aaa.com设置

.htaccess文件,跳转代码以下:php

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    RewriteRule ^index.html$ http://www.qiuxue365.cn/ [L,R=301]
    RewriteRule ^index/index.html$ http://www.qiuxue365.cn/ [L,R=301]
   
    RewriteCond %{http_host} ^qiuxue365.cn [NC]                // 顶级域名跳转
    RewriteRule ^(.*)$ http://www.qiuxue365.cn/$1 [L,R=301]    // 顶级域名跳转 
RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}.html [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>


用本身的网站www.qiuxue365.cn测试了,成功返回301:html

相关文章
相关标签/搜索