have dynamic segments in htaccess as part of a static redirect
I'm trying to make half of a redirect dynamic while the other is static revelant to the dynamic segment.
^img/default/?$ assets/default/themes/ [QSA,L]
what I want it to work with is something like
/img/default/folder1/folder2/img.png -> /assets/default/themes/folder1/folder2/img.png
another use that I want to be able to work is
/img/default/folder1/img.png -> /assets/default/themes/folder1/img.png
without making a rewrite rule for every single possible url i may have restricting me from making some 开发者_StackOverflow社区dynamic references.
Will something like this work?
Try these rules in your .htaccess file:
RewriteEngine on
Options +FollowSymlinks -MultiViews
RewriteRule ^img/default/(.*)$ /assets/default/themes/$1 [R=301,L,NC]
精彩评论