【问题标题】:Apache Rewrite Dynamic SubfolderApache 重写动态子文件夹
【发布时间】:2020-05-31 22:13:42
【问题描述】:

我可以像下面的示例那样重写 .htaccess 中的 url 并从 url 中删除动态部分吗?

https://example.com/abc/123/efg => https://example.com/abc/efg

123 是动态的。

【问题讨论】:

    标签: regex apache .htaccess mod-rewrite


    【解决方案1】:

    我只是像这样使用 RedirectMatch 指令:

    RedirectMatch 301 /abc/([0-9]+)/(.*) /abc/$2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-04
      • 2015-04-06
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 2012-09-22
      • 2015-09-27
      相关资源
      最近更新 更多