我正在褪色,需要一些帮助。我使用3周的RewriteRules来完成,我认为有些事情应该只有一个:我可以将这3个重写规则合并为1吗?
RewriteRule ^([0-9]+)$ /bar/$1.html [R=301,L]
RewriteRule ^([0-9]+)(-*)$ /bar/$1.html [R=301,L]
RewriteRule ^([0-9]+)-([0-9]+)$ /bar/$1.html#$2 [R=301,NE,L]
我需要采取以下网址:
http://foo.com/100
http://foo.com/100-1
http://foo.com/200-
http://foo.com/1999
http://foo.com/1999-99
...并重写它们是这样的:
http://foo.com/bar/100.html
http://foo.com/bar/100.html#1
http://foo.com/bar/200.html
http://foo.com/bar/1999.html
http://foo.com/bar/1999.html#99
我有什么作品但似乎有点破解。有没有办法将这一切结合到一个规则中?
哦,谢谢。现在很明显,你提到了前两者的结合。很显然,我一直在看它太久了。 – TunaMaxx