![](/img/trans.png)
[英]500 Internal Server Error CodeIgniter htaccess mod_rewrite
[英].htaccess (mod_rewrite) 500 Internal Server Error
我的.htaccess文件中有此文件,但出現500內部服務器錯誤。 我幾乎嘗試了在Internet上找到的針對mod_rewrite的所有內容,但這仍然無濟於事。 我該如何解決?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^zip/([A-Z]*)/([a-zA-Z]*)$ zip.php?state=$1&city=$2 [L,QSA]
</IfModule>
ErrorDocument 404 /404.php
FileETag MTime Size
<IfModule mod_expires.c>
<filesmatch ".(jpg|jpeg|gif|png|ico|css|js|woff)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</IfModule>
您有問題mod_deflate.c確保啟用了deflate模塊。 您可以刪除它以使其工作,如下所示。
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^zip/([A-Z]*)/([a-zA-Z]*)$ zip.php?state=$1&city=$2 [L,QSA]
ErrorDocument 404 /404.php
FileETag MTime Size
<IfModule mod_expires.c>
<filesmatch ".(jpg|jpeg|gif|png|ico|css|js|woff)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
</filesmatch>
</IfModule>
嘗試將所有mod_rewrite指令包含在ifmodule容器中:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^zip/([A-Z]*)/([a-zA-Z]*)$ zip.php?state=$1&city=$2 [L,QSA]
</IfModule>
如果可以解決問題,則說明您沒有加載mod_rewrite。 否則,是時候從htaccess文件中刪除行,直到不再收到500錯誤為止。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.