问题
How to redirect the path using string compare.
For example: We have path like (1000+ redirections)
www.example.com/kb-123
www.example.com/kb-555
www.example.com/kb-666
Now using single rule how to redirect all above path's into below path's?
www.example.com/article/kb-123
www.example.com/article/kb-555
www.example.com/article/kb-666
回答1:
Try with below rule,
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.+)
RewriteRule ^ /article/%1 [R=301,L]
来源:https://stackoverflow.com/questions/44269702/path-string-wise-match-redirection-in-htaccess