【问题标题】:Apache Redirect - case insensitiveApache 重定向 - 不区分大小写
【发布时间】:2017-05-04 17:37:00
【问题描述】:

如何从https://example.com/productshttps://example.com/newPath 之类的链接进行强大的永久网络重定向

重定向应该不区分大小写。例如调用https://example.com/ProDucTs 也应该可以工作。

我认为解决方案应该包含这样的内容

重写条件 ????? [NC] 重写规则?????[L,R=301]

【问题讨论】:

    标签: apache .htaccess redirect mod-rewrite


    【解决方案1】:

    你可以在你的 htaccess 文件中设置这两个规则

    RedirectMatch 301 (?i)/android-app  https://play.google.com/app-url
    

    RewriteRule ^products$ /newPath? [L,R=301,NC] 
    

    在上述两条规则中,“?i”和“NC”不区分大小写。

    【讨论】:

      猜你喜欢
      • 2014-10-31
      • 2021-06-30
      • 2014-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-01
      相关资源
      最近更新 更多