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

2019-11-04  本文已影响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

上一篇下一篇

猜你喜欢

热点阅读