2010-06-07 54 views
0

我遇到了一個我無法理清的.htaccess規則問題。它適用於我的MAMP堆棧,它可以在其他3臺服務器上運行,但它不能在特定的服務器上運行,並且一直給我一個「500錯誤和額外的302錯誤」。.htaccess通配符問題

這是從谷歌研究中拋出它的通配符,它​​表示它可能是由於無限循環,但它適用於其他服務器就好了。

有問題的網站是在子目錄正在開發中,但話又說回來,所以有其他網站:

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^$ public/ [L] 
RewriteRule (.*) public/$1 [L] 

/大衆都有自己的.htaccess文件是:

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

爲的mod_rewrite的任何建議不是我的專業,我似乎無法修復this.2

回答

0

嘗試

主:

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteBase /subdir 

RewriteRule ^$ public/ [L] 
RewriteRule (.*) public/$1 [L] 

/公衆的.htaccess

RewriteBase /subdir/public 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

任何運氣?

+0

不 - 它找不到/ public(這是正確的,因爲它是subdir/public),但只要我將第一個更改爲(。*)subdir/public/$ 1 [L]我再次得到500錯誤。我在各個部分嘗試了subdir,並且都出現了500或302錯誤。根據信息更新答案 – niggles 2010-06-08 00:05:25

+0

- 有沒有運氣?我建議它,因爲一些主機有問題,如rackspacecloud,godaddy等 – 2010-06-08 00:44:47

+0

你知道什麼,它不是.htaccess - 我剝離/public/index.php文件到什麼都沒有,它的工作...不斷添加行回來而事實證明這個服務器正在與數據庫會話存儲緊密相連!調用session_start()會導致500錯誤,但僅在使用我的數據庫存儲類時發生。哦,新的問題排序:-) – niggles 2010-06-08 02:12:48