仅针对一个文件夹重写 isapi
我在 /shop/cart-plugins/subscription-wizard/ 有一个物理文件夹。为了让用户更容易找到,我在 htaccess 文件中设置了以下规则,将其转换为 /join/。
如果他们输入 www.mywebsite.com/join/,效果会很好,但如果他们不输入最后一个斜杠标记,则不会执行任何操作。我查遍了谷歌,但无法弄清楚。如果您有任何建议,我们将不胜感激。
这是我制定的规则。
RewriteRule ^shop/cart-plugins/subscription-wizard? /join/$1 [NC,R=301,L]
RewriteRule ^shop/cart-plugins/subscription-wizard/? /join/$1 [NC,R=301,L]
RewriteRule ^shop/cart-plugins/subscription-wizard/(.*) /join/$1 [NC,R=301,L]
RewriteRule ^join/(.*) /shop/cart-plugins/subscription-wizard/$1 [QSA]
谢谢...
I have a phycical folder at /shop/cart-plugins/subscription-wizard/. To make it easier for users find I have set up the following rule in my htaccess file to turn this into /join/.
It works great if they type in www.mywebsite.com/join/, but if they don't type in the last slash mark it doesn't do anything. I've looked all over google, but can't figure it out. Any advice you might have would be greatly appreciated.
Here's the rule I have set up.
RewriteRule ^shop/cart-plugins/subscription-wizard? /join/$1 [NC,R=301,L]
RewriteRule ^shop/cart-plugins/subscription-wizard/? /join/$1 [NC,R=301,L]
RewriteRule ^shop/cart-plugins/subscription-wizard/(.*) /join/$1 [NC,R=301,L]
RewriteRule ^join/(.*) /shop/cart-plugins/subscription-wizard/$1 [QSA]
Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)