问题
how to write one rule what would satisfy all this redirect what I try to achive with the following rules
RewriteRule ^desktop/page/1/ /tag/desktop/page/1/ [R,L]
RewriteRule ^desktop/page/2/ /tag/desktop/page/2/ [R,L]
RewriteRule ^desktop/page/3/ /tag/desktop/page/3/ [R,L]
RewriteRule ^desktop /tag/desktop [R,L]
the last one is never executed
回答1:
Try:
RewriteRule ^desktop(/.*)?$ /tag/desktop$1 [R,L]
Or if you must limit it to page/number:
RewriteRule ^desktop(/(page/[0-9]+/?)?)?$ /tag/desktop$1 [R,L]
来源:https://stackoverflow.com/questions/12686839/htaccess-redirect-with-on-rule