开发者

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

开发者 https://www.devze.com 2023-02-13 13:26 出处:网络
How to make the same rewrite rule without using THE_REQUEST? RewriteEngine On # Rewrite multiple slashes with single slash after domain

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

精彩评论

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