2015-07-22 43 views
1

嗨我得到了一個驚人的(?)工作來解決網站上的錯誤。這是一個HTTP 500錯誤。 它是由htaccess文件引起的。但我無法弄清楚代碼有什麼問題。這裏是代碼。以下htaccess規則有什麼問題

# Use PHP5 Single php.ini as default 
#AddHandler application/x-httpd-php5s .php 


# The rules below basically say that if the file exists in the tree, just 
# serve it; otherwise, go to index.php. This is more future-proof for your 
# site, because if you start adding more and more content types, you don't 
# need to alter the .htaccess to accomodate them. 
# This is an important concept for the Front Controller Pattern which the 
# ZF MVC makes use of. 

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ public/index.php [NC,L] 
Redirect 301 /platforms/mt4-ecn http://example.com/ 
Redirect 301 /partnerships/mt4-to-mt4-bridge http://example.com/ 

<IfModule mod_suphp.c> 
suPHP_ConfigPath /home/aaaecn/public_html 
</IfModule> 
<Files php.ini> 
order allow,deny 
deny from all 
</Files> 

這個重定向規則適用於zend框架,但我沒有任何使用該框架的經驗。

我評論了所有的行,現在試着500錯誤是固定的。所以我通過取消註釋將其過濾掉。 。

重寫規則^ * $ - [NC,L]

此行引起錯誤,但刪除此給予無效的重定向和404錯誤。我能做些什麼來解決這個問題。

回答

1

試試你的規則是這樣的:

RewriteEngine On 

RewriteRule ^(partnerships/mt4-to-mt4-bridge|platforms/mt4-ecn)/?$/[L,NC,R=301] 

RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^public/index.php [L] 
+0

仍然得到一個500錯誤 – Vignesh

+0

檢查你的Apache error.log中,並在這裏貼上完整的錯誤文本。 – anubhava

+0

我的不好,問題甚至沒有在這個代碼裏面。他們故意將該站點重定向到公共文件夾htaccess文件中的另一個站點。剛纔注意到了。我刪除了,這個網站的工作..我仍然不明白爲什麼這樣的一個混亂髮生在這裏..無論如何感謝您的幫助.. – Vignesh