.htaccess 重写URL并重定向到新格式

.htaccess 重写URL并重定向到新格式,.htaccess,mod-rewrite,redirect,url-rewriting,.htaccess,Mod Rewrite,Redirect,Url Rewriting,我想知道我是否可以得到一些帮助来更改URL 我想改变和匹配所有城市/州的URL的不同格式,并有他们重定向到新的URL,如果有人在他们的土地上 我想更改和重定向: http://www.domain.com/FL/Miami.html to http://www.domain.com/miami-fl/ 我现在想要更改并重定向到新规则的规则: RewriteEngine On RewriteRule ^(.*)/(.*)\.html$ index.php?st=$1&cit

我想知道我是否可以得到一些帮助来更改URL

我想改变和匹配所有城市/州的URL的不同格式,并有他们重定向到新的URL,如果有人在他们的土地上

我想更改和重定向:

http://www.domain.com/FL/Miami.html

to 

http://www.domain.com/miami-fl/
我现在想要更改并重定向到新规则的规则:

RewriteEngine On    
RewriteRule ^(.*)/(.*)\.html$ index.php?st=$1&city=$2 [L]

只要情况不重要,您可以这样做:

RewriteEngine On    
RewriteRule ^(.+)-([^/-]+)\.html$ index.php?st=$2&city=$1 [L]