[英]htaccess throwing 500 server error
我只是設置WAMP來開發一個新站點,並且當我添加一個.htaccess文件並將所有URL扔到我的url處理程序文件中時,出現500個服務器錯誤。 我猜這是某種語法錯誤? 我確實在apache中啟用了重寫模塊。
這是.htaccess文件:
Options +FollowSymLinks
RewriteEngine ON
RewriteRule ^(.*)(\.(jpg|jpeg|gif|png|css|ico|xml|txt|pdf|js|ttf|woff)) - [NC,L]
RewriteRule ^(.*)$ handler.php [L,QSA]
apache日志顯示以下內容:
[core:error] [pid 3032:tid 1136] [client 127.0.0.1:55367] AH00124:由於可能的配置錯誤,請求超出了10個內部重定向的限制。 必要時使用'LimitInternalRecursion'增加限制。 使用“ LogLevel調試”獲取回溯。
嘗試在您的規則中添加RewriteCond
,如下所示:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !\.(jpe?g|gif|png|css|ico|xml|txt|pdf|js|ttf|woff)$ [NC]
RewriteRule !^handler\.php$ handler.php [L,NC]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.