1

I have the following rules in my htaccess file:

RewriteRule ^animals$ ?filter=$1 [L]
RewriteRule ^plants$ ?filter=$1 [L]
RewriteRule ^tech$ ?filter=$1 [L]
RewriteRule ^social ?filter=$1 [L]

Is there a way to combine these into 1 rule? as the list is actually larger than that and it's the same rule.

4

1 回答 1

1

是的,它可以使用 regex 组合成一个规则OR

RewriteRule ^(animals|plants|tech|social)/?$ ?filter=$1 [L,NC,QSA]
于 2013-10-25T13:40:20.723 回答