htaccess 301 mod 重写匹配的 url 模式
恐怕这超出了我的能力,经过大量研究和破坏后,我来寻求帮助。我有一个网址格式为:
example.com/7865/travel-photo/my-amazing-photo
我的客户现在决定在照片上添加“s”,因此网址变为:
example.com/7865/travel-photos/my-amazing-photo
一切都很好,仅此一点就不会成为问题,因为每个 URL 的数字“7865”都会发生变化,就像“我的令人惊叹的照片”确实如此。新 URL 的基本结构需要是:
example.com/'numbervariable'/travel-photos/'article namevariable'
所以我的问题是如何为此编写一个漂亮的 htaccess mod 重写规则?
This one's beyond my ability I'm afraid and after much research and breaking things I've come for help. I have a site with a URL in the format of:
example.com/7865/travel-photo/my-amazing-photo
My client has now decided he'd like to add an 's' onto photos so the URL has become:
example.com/7865/travel-photos/my-amazing-photo
All great and that alone wouldn't have been a problem only for the fact that the number '7865' changes for each URL just like the 'my-amazing-photo' does. The basic structure of the new URL needs to be:
example.com/'number variable'/travel-photos/'article name variable'
So my question how does write a beautiful htaccess mod rewrite rule for that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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