在 htaccess 中有动态段作为静态重定向的一部分
我试图使重定向的一半是动态的,而另一半是与动态段相关的静态的。
^img/default/?$ assets/default/themes/ [QSA,L]
我希望它能够使用的是类似于
/img/default/folder1/folder2/img.png -> /assets/default/themes/folder1/folder2/img.png
我希望能够工作的另一种用途,即
/img/default/folder1/img.png -> /assets/default/themes/folder1/img.png
无需为每个可能的网址制定重写规则,我可能会限制我进行一些动态引用。
这样的事情会起作用吗?
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 dynamic references.
Will something like this work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 .htaccess 文件中尝试以下规则:
Try these rules in your .htaccess file: