【问题标题】:I would like to rewrite an URL in php (.htaccess)我想用 php (.htaccess) 重写一个 URL
【发布时间】:2021-04-18 09:14:03
【问题描述】:

这个问题可能是重复的,但我没有找到任何对我有帮助的答案。 我想将此网址:https://example.com/mobilier.php?is=24&s=tables 重写为https://example.com/mobilier/24/tables 而这个网址:https://example.com/product.php?id=110&nom=table-de-nuit 变成 https://example.com/product/110/table-de-nuit

【问题讨论】:

    标签: php html url-rewriting get


    【解决方案1】:

    试试这个 .htaccess 规则

    redirectMatch 301 ^example.com/mobilier.php?is=24&s=tables$ https://example.com/mobilier/24/tables
    redirectMatch 301 ^example.com/product.php?id=110&nom=table-de-nuit$ https://example.com/product/110/table-de-nuit
    

    如果你想为很多网址这样做,请重新考虑你的做事方式

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-01
      • 2018-05-31
      • 2019-12-11
      • 1970-01-01
      • 1970-01-01
      • 2018-12-03
      • 1970-01-01
      • 2014-09-30
      相关资源
      最近更新 更多