简体   繁体   中英

htaccess throwing 500 server error

I just set up WAMP to develop a new site and when I added an .htaccess file that throws all URLS to my url handler file, I get 500 server errors. I'm guessing it's some kind of syntax error? I do have the rewrite module enabled in apache.

here's the .htaccess file:

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 log shows this:

[core:error] [pid 3032:tid 1136] [client 127.0.0.1:55367] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Try adding RewriteCond in your rules like this:

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM