2015-07-20 86 views
0

我的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安裝的人......有其他人必須解決這個問題嗎?

感謝

+0

爲什麼'Options -MultiViews'被註釋掉了? – anubhava

+0

它在laravel提供的默認.htaccess文件中被註釋掉了。我試着在mod_rewrite的內部和外部啓用它。可能只是不必要的。 – aceslowman

+0

檢查您的服務器日誌並確保重定向仍然正確連接了查詢字符串 – Deinumite

回答

2

在重寫規則

RewriteRule ^(.*)$ /international-experts/index.php/?$1 [L] 

創建一個新的查詢字符串?$1,並在這種情況下,默認行爲是要扔掉舊的查詢字符串。您需要使用的國旗QSA,你可以記得「查詢字符串追加」

RewriteRule ^(.*)$ /international-experts/index.php/?$1 [L,QSA] 

如果沒有足夠的解決您的問題,肯定是它的一部分。

+0

美麗,不夠感謝你。 – aceslowman

+1

@AustinSlominski很酷,那就是問題所在,然後:-),不客氣! – Zimmi