使用通配符的棘手的HTACCESS重定向
我有一个客户请求重写以下内容,其中“任何事物”可以是任何名称的目录:
https://clientdomain.com/anything/final-destination
to:
https://clientdomain.com/final-destination
我知道我可以识别以下正则:
(?<=clientdomain.com\/)(.*)(?=final-destination)
...但是如何将其纳入工作规则使我难以置信
I have a client request to rewrite the following, where "anything" can be any named directory:
https://clientdomain.com/anything/final-destination
to:
https://clientdomain.com/final-destination
I know I can identify "anything" with the following regex:
(?<=clientdomain.com\/)(.*)(?=final-destination)
...but how to incorporate that into a working rule eludes me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用此规则,而无需任何lookahead:
shere
[^/]+
匹配的1个或更多不是/
的字符中的1个或更多字符。You may use this rule without any lookahead:
Here
[^/]+
matches 1 or more of any character that is not/
.