簡體   English   中英

將 https 重定向到 http,除了 .htaccess 中的 onepagecheckout

[英]Redirect https to http except onepagecheckout in .htaccess

我想將我所有的 https 重定向到 http,除了下面的 url。

https://uae.example.com/ae_en/onepagecheckout/

RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^$onepagecheckout
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

此代碼正在工作並將所有 https 重定向到 http,但似乎我的第二個 RewriteCond 不起作用。 請幫忙

這樣做:

RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} !/onepagecheckout [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NE,L]

使用%{THE_REQUEST}變量而不是具有正確正則表達式模式的%{REQUEST_URI}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM