美文网首页
ThinkPHP6 URL重写去掉index.php不生效 .h

ThinkPHP6 URL重写去掉index.php不生效 .h

作者: 思议岁月 | 来源:发表于2019-11-04 10:22 被阅读0次

    thinkphp6已经更新,tp6初次使用重写失败,开启多应用模式后,index.php无法去除,No input file specified,以下是解决办法.
    本人用的是phpstudy php7的环境,在确认httpd.conf配置文件中加载了mod_rewrite.so模块和AllowOverride None 将None改为 All后依然不生效,将问题锁定到.htaccess中。

    原官方.htaccess文件内容

    <IfModule mod_rewrite.c>
      Options +FollowSymlinks -Multiviews
      RewriteEngine On
    
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    </IfModule>
    

    修改后的.htaccess文件内容

    <IfModule mod_rewrite.c>
      Options +FollowSymlinks -Multiviews
      RewriteEngine On
    
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
    </IfModule>
    

    参考文章:https://www.cnblogs.com/wsw8384/p/9327351.html

    相关文章

      网友评论

          本文标题:ThinkPHP6 URL重写去掉index.php不生效 .h

          本文链接:https://www.haomeiwen.com/subject/znprbctx.html