【问题标题】:Stripping the end of a url in the .htaccess file剥离 .htaccess 文件中 url 的结尾
【发布时间】:2010-12-18 20:14:05
【问题描述】:

我的网站上有数百个 404 错误问题,这些错误是由表达式“URLONCLICK”和“%5C”以某种方式插入到正确 url 的末尾引起的,我不知道它来自哪里但我只想将它从 .htaccess 文件中的 url 末尾剥离。我该怎么做?

即 www.mydomain.com/category/post-title/URLONCLICK www.mydomain.com/category/post-title/%5C

我想去掉这些网址的结尾,使它们看起来像: www.mydomain.com/category/post-title/

【问题讨论】:

    标签: url .htaccess rewrite stripping


    【解决方案1】:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteRule ^(.*)\%5c $ $1 [NC]
    RewriteRule ^(.*)\URLONCLICK $ $1 [NC]
    

    这应该可以。也许有更好的方法(合并最后两行)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-06-29
      • 1970-01-01
      • 2018-04-03
      • 2010-10-17
      • 2023-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多