开发者

Apache: How to make the same rewrite rule without using THE_REQUEST?

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/id


How 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}.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜