简体   繁体   中英

Loop produced by .htaccess gives message ERR_TOO_MANY_REDIRECTS

I'm playing around with .htaccess to have more clean URLs. My .htaccess is the following:

RewriteEngine On
RewriteBase /

RewriteRule SmartMenu SmartMenuPrototype/dashboard [NC,L]

The browser gives me the ERR_TOO_MANY_REDIRECTS message. And in the apache2 error log file I get this message:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. etc..

I suppose I'm creating a loop somehow, but I'm new to the syntax.

You need to use anchors in your regex:

RewriteEngine On
RewriteBase /

RewriteRule ^SmartMenu/?$ SmartMenuPrototype/dashboard [NC,L]

Otherwise SmartMenu will also match SmartMenuPrototype .

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