2011-08-24 49 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]