mod_rewrite 显示更简单的 URL?
我希望在我的网站上显示此位置:
http://www.mywebsite.com/Facilities/Fishing/
向用户显示如下:
http://www.mywebsite.com/Fishing
我也希望用户能够访问该 (http://www.mywebsite.com/Fishing) URL,并在显示时被重定向(仅限内部)到 (http://www.mywebsite.com/Facilities/Fishing/) (http://www.mywebsite.com/Fishing) URL。
基本上我不希望用户看到该目录,即使它确实存在。
I want this location on my website:
http://www.mywebsite.com/Facilities/Fishing/
to display to the user as this:
http://www.mywebsite.com/Fishing
I also want users to be able to visit that (http://www.mywebsite.com/Fishing) URL, and be redirected (internally only) to (http://www.mywebsite.com/Facilities/Fishing/) WHILE being shown the (http://www.mywebsite.com/Fishing) URL.
Basically I don't want the user to ever see that directory, even though it does exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用重写规则:
Using RewriteRule:
尝试:
这会砍掉
设施
位。Try:
This chops off the
Facilities
bits.