mod_rewrite URL 之前的 N 个目录
我想从格式如下的 URL 重定向用户:
http://blog.mysite.com/any/number/of/directories/<POSTNAME>.html
TO:
http://mysite.com/about/blog/entry/<POSTNAME>/
哪里是相同的连字符分隔的字符串,并且原始 URL 在文件名之前可以有任意数量的目录(其中没有一个目录被“传递”到新 URL) 。
是否可以创建读取此模式的 htaccess 规则?
非常感谢您的帮助! :)
I want to redirect users from a URL formatted like this:
http://blog.mysite.com/any/number/of/directories/<POSTNAME>.html
TO:
http://mysite.com/about/blog/entry/<POSTNAME>/
Where is the same hyphen-separated string, and, the original URL can have any number of directories before the filename (none of which are 'passed' to the new URL).
Is it possible to create a htaccess rule which reaads this pattern?
Many thanks for your help! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你正在寻找这样的东西:
I think you're looking for something like this: