开发框架 版主:迅睿框架研发组
首页index.php如何301跳转
类型:迅睿CMS 更新时间:2024-08-14 13:22:45 CodeIgniter

首页域名后出现index.php,并且访问域名+index.php/目录/   也能访问

如何取消呢?

image

image

回帖
  • 外聘专员-小波工作室
    #1楼    外聘专员-小波工作室
    2024-08-13 14:22:21
    Chrome 0
    系统-地址唯一关闭
  • 华清阳君
    #2楼    华清阳君
    2024-08-13 14:25:28
    Chrome 0
    外聘专员-小波工作室
    image
    已经关闭状态中
  • 外聘专员-小波工作室
    #3楼    外聘专员-小波工作室
    2024-08-13 14:52:58
    Chrome 0
    对了,你这样改成了自由参数,就不会进行跳转了,如果他仍然在跳那么就也许是官方程序的bug了
  • 华清阳君
    #4楼    华清阳君
    2024-08-13 15:09:39
    Chrome 0
    外聘专员-小波工作室 从发现问题开始,这个自由参数选项就是这个的现在查看http状态码如下图
    image

    image
    我用.htaccess来写伪静态RewriteCond %{HTTP_HOST} ^www.hrbpinpaicehua.com$ [NC] RewriteCond %{REQUEST_URI} ^/index.php [NC] RewriteRule .* / [R=301,L] 上述情况的http状态码就是301了但是向http://www.hrbpinpaicehua.com/sitemap.xml 这些伪静态文件就无法打开了。现在实在是不知道哪里出了问题。
  • 华清阳君
    #5楼    华清阳君
    2024-08-14 13:22:04
    Chrome 0
    华清阳君 # index.php 301跳转代码! RewriteCond %{THE_REQUEST} /index\.php [NC]# index.php 301跳转主页! RewriteRule ^index\.php$ http://www.hrbpinpaicehua.com/ [R=301,L]# /index.php/ index.php目录跳转主页! RewriteRule ^index\.php/$ http://www.hrbpinpaicehua.com/ [R=301,L]# /index.php/目录/ 跳转! RewriteRule ^index.php/([a-zA-Z]+)/?$ http://www.hrbpinpaicehua.com/$1/ [L,R=301,QSA]# /index.php/目录/数字.html 跳转!新闻页面使用 RewriteRule ^index.php/([a-zA-Z]+)/(\d+).html$ http://www.hrbpinpaicehua.com/$1/$2.html [L,R=301,QSA]# /index.php/目录/数字_分页.html 跳转!栏目分页使用 RewriteRule ^index.php/([a-zA-Z]+)/(\d+)_(\d+)\.html$ http://www.hrbpinpaicehua.com/$1/$2_$3.html [L,R=301,QSA]# /index.php/英文字母.html 跳转!聚合资讯根目录单页使用RewriteRule ^index.php/([a-zA-Z]+)\.html$ http://www.hrbpinpaicehua.com/$1.html [L,R=301,QSA]# /index.php/英文字母/英文字母.html 跳转!tag标签使用RewriteRule ^index.php/([a-zA-Z]+)/([a-zA-Z]+)\.html$ http://www.hrbpinpaicehua.com/$1/$2.html [L,R=301,QSA]# /index.php/英文字母/英文字母-p数字.html 跳转!tag标签分页使用RewriteRule ^index.php/([a-zA-Z]+)/([a-zA-Z]+)-p(\d+)\.html$ http://www.hrbpinpaicehua.com/$1/$2-p$3.html [L,R=301,QSA]# /index.php/英文字母/英文字母.xml 跳转!网站地图使用RewriteRule ^index.php/([a-zA-Z]+).xml$ http://www.hrbpinpaicehua.com/$1.xml [L,R=301,QSA]# /index.php/英文字母.txt 跳转!网站地图使用RewriteRule ^index.php/([a-zA-Z]+).txt$ http://www.hrbpinpaicehua.com/$1.txt [L,R=301,QSA]
    满意答案
  • 华清阳君
    #6楼    华清阳君
    2024-08-14 13:22:45
    Chrome 0
    @华清阳君:.htaccess文件做了点规则,目前验证是没有问题的。