TP5 无法获取到GET参数(apache)

这种情况很可能是和服务器配置相关的。
例如本人的情况就是下载了一个新的项目,但是里面的.htaccess文件有问题导致无法获取到get参数,
原来的是这样:

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

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

改过之后是:

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

然后就可以获取到get参数了。
拿走不谢!

猜你喜欢

转载自blog.csdn.net/qq_39399594/article/details/83109384