我的laravel应用程序在localhost上运行良好,但现在已将应用程序移至生产服务器,它不再识别通过URL传递的任何$ _GET变量。我的生产服务器设置为允许多个laravel安装,并且我正在使用位于laravel根目录中的vhost.conf文件和.htaccess文件处理重写。
的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /international-experts/index.php/?$1 [L]
</IfModule>
vhost.conf
Alias /international-experts "/srv/http/international-experts/public"
<Directory /srv/http/international-experts>
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo Indexes
Order allow,deny
Allow from all
</Directory>
我做了什么,以测试它与多页的print_r($ _ GET)。没有。阅读这个问题,听起来像MultiViews可能是问题的一部分。我知道我不是唯一一个在同一台服务器上处理多个laravel安装的人......有其他人必须解决这个问题吗?
感谢
为什么'Options -MultiViews'被注释掉了? – anubhava
它在laravel提供的默认.htaccess文件中被注释掉了。我试着在mod_rewrite的内部和外部启用它。可能只是不必要的。 – aceslowman
检查您的服务器日志并确保重定向仍然正确连接了查询字符串 – Deinumite