2015-08-28 18 views
2

.htaccess顯示500服務器錯誤。
文件的位置是根文件夾。 下面是代碼:htaccess - 顯示500錯誤甚至啓用本地主機上httpd.conf中的htaccess文件

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
#RewriteRule .signup.php [L] 
RewriteRule .* .signup.php [PT,L] 
</IfModule> 

我已經啓用htaccess文件在httpd.conf文件 是

<Directory /> 
    Options FollowSymLinks 
    AllowOverride all 
    Order deny,allow 
    Deny from all 
    Satisfy all 
</Directory> 

LoadModule rewrite_module modules/mod_rewrite.so 

回答

1

RewriteBase線故障不指定一個目錄。
嘗試下列操作之一:RewriteBase / - 或者 - 完全刪除該行。
如果不工作,我認爲這將是更安全的寫.htaccess文件像這樣:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/

#If we're already on .signup.php, exit so we don't get stuck in a loop 
    RewriteRule .signup.php - [L] 

#If doesn't exist 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
#rewrite to .signup.php and read from the top of .htaccess again 
    RewriteRule .* .signup.php [PT,L] 
</IfModule> 

這樣,我們避免重定向的情況下,循環的.signup.php文件不存在,要麼..
如果仍然無法正常工作,請嘗試在沒有PT標誌的情況下進行測試,如果您不確定是否知道自己在做什麼,則存在使.htaccess複雜化的傾向。

+0

謝謝@Ultimater ....! – Omkar

+1

一個「點文件」(即'.signup.php')作爲一個可公開訪問的文件看起來也很奇怪嗎?大多數服務器會主動阻止訪問,這也可能導致500錯誤。 (?) – MrWhite