0
這裏是我的.htaccess
爲什麼我的規則總是重定向,即使我放置[L]?
RewriteEngine on
RewriteRule .* index.php?url=$0 [L]
而且我index.php
文件:
<?php
var_dump($_GET);
當我去mysite/cat
我得到:
array
'url' => string 'index.php' (length=9)
這表明它重定向兩次,index.php
越來越塞入url
。我以爲[L]
應該阻止這種情況?
那麼停止它的最好方法是什麼? 'RewriteCond%{REQUEST_FILENAME}!index.php'? – mpen 2011-03-07 00:05:09
這是一種方法。另一種方法是使用'-f'和'-d'來避免重定向實際存在的事物。 – 2011-03-07 00:12:27