开发者

Why does my rule always redirect even though I put [L]?

Here's my .htaccess

RewriteEngine on
RewriteRule .* index.php?url=$0 [L]

And my index.php file:

<?php
var_dump($_GET);

When I go to mysite/cat I get:

array
  'url' => string 'index.php' (length=9)

Which suggests that it redirects twice, and index.php is开发者_JAVA百科 getting stuffed into url. I thought [L] was supposed to prevent that?


The Lflag does prevent further RewriteRules from being applied for the current request, but if an external redirect occurs then the entire set of rules will be re-entered from the top again regardless.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜