2017-05-05 40 views
0

在我的.htaccess文件中使用這個RewriteRule我得到了RewriteRule:壞標誌分隔符,它在瀏覽器中返回500錯誤。 .htaccess文件位於根目錄中。.htaccess:重寫規則:壞標誌分隔符 - Apache錯誤

這裏的代碼的.htaccess:

RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !=d 
RewriteCond %{REQUEST_FILENAME} !=f 
RewriteCond %{REQUEST_FILENAME} !=l 

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

,這裏是Apache的錯誤:

[Fri May 05 16:11:16.180048 2017] [core:alert] [pid 8924:tid 1708] [client ::1:58526] C:/lol/htdocs/proyecto_cf/.htaccess: RewriteRule: bad flag delimiters 
+0

該錯誤似乎與您發佈的指令有關?除非你在該行中有一些隱藏的字符? – MrWhite

+0

這就是整個代碼。它似乎沒有錯誤..但我在瀏覽器中得到一個500錯誤 – pipex666

+1

請注意,'!= d'應該是'!-d'等,如下所述(但是,這不會導致一個錯誤)。試着將這些代碼複製回你的'.htaccess'文件中,如果你仍然有500錯誤,那麼再次檢查你的錯誤日誌。 – MrWhite

回答

0

我從來沒有見過-l,嘗試刪除該行。

# Handles directories 
RewriteCond %{REQUEST_FILENAME} !-d 

# Handles files 
RewriteCond %{REQUEST_FILENAME} !-f 

# If not a file and not a directory we redirect to index.php 
RewriteRule^index.php [L] 
+2

'-l'測試符號鏈接並且是有效的(如果需要的話)。但是,OP使用'=',它永遠不會匹配(但不會導致報告的錯誤)。 – MrWhite