PHP software system does not support URL rewriting solutions

 

Recently, a PHP software was installed in the local win environment, and an error was reported as shown in the figure

Consult the TP document and start the rewrite steps as follows:

可以通过URL重写隐藏应用的入口文件index.php(也可以是其它的入口文件,但URL重写通常只能设置一个入口文件),下面是相关服务器的配置参考:

[ Apache ]
httpd.conf配置文件中加载了mod_rewrite.so模块
AllowOverride None 将None改为 All
把下面的内容保存为.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>

But clicking on the link still can't display:

Modified and checked the configuration of PHP.ini and httpd.cof according to the solution of netizens, and still reported an error. Later, I saw the following sentence to solve the problem:

打开.htaccess 在RewriteRule 后面的index.php教程后面添加一个“?”

So after adding it, it is normal, hereby record

<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>

 

Guess you like

Origin blog.csdn.net/EasyTure/article/details/109765799