2011-08-24 60 views
0

我有以下幾點:的.htaccess的mod_rewrite和

RewriteRule ^(.*)/(.*)\.php?$ index.php?city=$1 [L] 

它抓住了:mysite.com/salt-lake-city/file.php

我希望它也搭上了:mysite的。 com/salt-lake-city /並轉發到:index.php?cit = salt-lake-city。我試着添加:

RewriteRule ^(.*)/?$ index.php?city=$1 [L] 

然而,這最終轉發到index.php城市= index.php文件

回答

0
RewriteRule ^(.*)/(.*\.php)?$ index.php?city=$1 [L]