Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess生成的循环为消息ERR\u提供了太多的重定向_Php_.htaccess - Fatal编程技术网

Php .htaccess生成的循环为消息ERR\u提供了太多的重定向

Php .htaccess生成的循环为消息ERR\u提供了太多的重定向,php,.htaccess,Php,.htaccess,我正在使用.htaccess来获得更干净的URL。我的.htaccess如下所示: RewriteEngine On RewriteBase / RewriteRule SmartMenu SmartMenuPrototype/dashboard [NC,L] 浏览器给了我ERR_TOO_MANY_重定向消息。在apache2错误日志文件中,我收到以下消息: Request exceeded the limit of 10 internal redirects due to probable

我正在使用.htaccess来获得更干净的URL。我的.htaccess如下所示:

RewriteEngine On
RewriteBase /

RewriteRule SmartMenu SmartMenuPrototype/dashboard [NC,L]
浏览器给了我ERR_TOO_MANY_重定向消息。在apache2错误日志文件中,我收到以下消息:

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

我想我是在以某种方式创建一个循环,但我对语法不太熟悉。

您需要在正则表达式中使用锚点:

RewriteEngine On
RewriteBase /

RewriteRule ^SmartMenu/?$ SmartMenuPrototype/dashboard [NC,L]
否则,
SmartMenu
也将匹配
SmartMenuPrototype