How to make the same rewrite rule without using THE_REQUEST
?
RewriteEngine On
# Rewrite multiple slashes with single slash after domain
RewriteCond %{THE_REQUEST} ^[A-Z]+\s//+(.*)\sHTTP/[0-9.]+$ [OR]
RewriteCond %{THE_REQUEST} ^[A-Z]+\s(.*/)/+\sHTTP/[0-9.]+$
RewriteRule .* http开发者_C百科://%{HTTP_HOST}/%1 [R=301,L,NE]
Update: .htaccess location - www.domain.com/url/.htaceess
Rewrite action - www.domain.com//url/id rewrited to www.domain.com/url/idHow about this?
RewriteCond %{REQUEST_URI} ^(.)//(.)$ RewriteRule . %1/%2 [R=301,L]
Taken from here. (Unfortunately I'm unable to test it here).
Seems there are no solution without Apache %{THE_REQUEST}
.
精彩评论