剥离.htaccess文件中的url的结尾

时间:2010-12-18 20:14:06

标签: url .htaccess rewrite stripping

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

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

我想删除这些网址的结尾,以便它们看起来像: www.mydomain.com/category/post-title /

1 个答案:

答案 0 :(得分:0)

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\%5c $ $1 [NC]
RewriteRule ^(.*)\URLONCLICK $ $1 [NC]

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