tp5.1用$this->request->param()接受数据多了一个参数 转

转自:https://blog.csdn.net/WYXXXXXXXXX/article/details/108408620

解决方案:

打开application目录下.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>

正常是像上面这样的语句,我们把最后一句注释掉,然后加上
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
#  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

OK,问题解决

点赞

发表回复

电子邮件地址不会被公开。必填项已用 * 标注