這裏是我完整的答案,以避免在使用懶惰匹配的網址重複的字符在以前的評論samurai8的建議:
重複SLASHS和破折號
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)(/{2,})(.*)$
RewriteRule . %1/%3 [R=301,L]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)(-{2,})(.*)$
RewriteRule . %1-%3 [R=301,L]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)(_{2,})(.*)$
RewriteRule . %1_%3 [R=301,L]
反覆字母詞彙
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)a{3,}(.*)$
RewriteRule . %1aa%2 [R=301,L]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)b{3,}(.*)$
RewriteRule . %1bb%2 [R=301,L]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{REQUEST_URI} ^(.*?)c{3,}(.*)$
RewriteRule . %1cc%2 [R=301,L]
.
.
.
使用懶惰匹配:'^(。*?)l {3,}(。*)$' – hjpotter92
這是我正在做的事情,但令人驚訝的是它只限於23個字符 – RafaSashi
您正在使用貪婪匹配' )',懶惰匹配是:'(。*?)' – hjpotter92