.htaccess htaccess使用双规则重写(带版本)

.htaccess htaccess使用双规则重写(带版本),.htaccess,version,double,rewrite,rule,.htaccess,Version,Double,Rewrite,Rule,我希望htaccess脚本伏都教可以在这里帮助我 我正试图让htaccess脚本使用两个规则工作 我使用第一条规则为不同版本使用文件夹,这很好: RewriteEngine On RewriteRule .* - [E=VERSION:020] RewriteRule ^versions/(.*)$ versions/$1 [L] RewriteRule ^(.*)$ versions/%{ENV:VERSION}/$1 [L] 然后我有了一个结构: http://domain.com/ ht

我希望htaccess脚本伏都教可以在这里帮助我

我正试图让htaccess脚本使用两个规则工作

我使用第一条规则为不同版本使用文件夹,这很好:

RewriteEngine On
RewriteRule .* - [E=VERSION:020]
RewriteRule ^versions/(.*)$ versions/$1 [L]
RewriteRule ^(.*)$ versions/%{ENV:VERSION}/$1 [L]
然后我有了一个结构:

http://domain.com/
http://domain.com/th?=1
http://domain.com/myfolder/
http://domain.com/myfile.html
并将用户发送到htaccess中设置的版本:

http://domain.com/versions/020/
http://domain.com/versions/020/th?=1
http://domain.com/versions/020/myfolder/
http://domain.com/versions/020/myfile.html
一切正常

但我想添加第二条规则,但我无法让它与第一条规则一起工作

我想获得以下URL:

http://domain.com/th/1
http://domain.com/th/12
并将用户发送到:

http://domain.com/?th=1
http://domain.com/?th=12
根据第一条规则的延伸:

http://domain.com/versions/020/?th=1
http://domain.com/versions/020/?th=12
我试图补充:

RewriteRule ^th/([0-9]+)/$ http://domain.com/versions/%{ENV:VERSION}/?th=$1
但这只适用于没有第一条规则的情况(奇怪的是,我也不能让它在没有域名的情况下工作)

如何使这两条规则协同工作?有什么提示吗

干杯

罗木