仅针对一个文件夹重写 isapi

发布于 2024-12-25 11:06:04 字数 566 浏览 1 评论 0原文

我在 /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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

阳光①夏 2025-01-01 11:06:04
RewriteRule ^join$ /join/ [L,R=301]
RewriteRule ^join$ /join/ [L,R=301]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文