gpt4 book ai didi

http - .htaccess 强制 https 但只有一个页面带有 http 或 https

转载 作者:太空宇宙 更新时间:2023-11-03 14:43:07 24 4
gpt4 key购买 nike

我想将所有页面重定向到 https,不包括一个页面!

此页面 www.domain.com/data/push-send 应可通过 http://或 https://访问

这是我当前的代码:

RewriteEngine On

# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ /$1 [R=301,L]

# enforce a no-trailing-slash policy
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Redirect api to data/push-send
RewriteRule ^api$ data/push-send [qsappend,L]

# no index in URL
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^(.*)$ http://www.domain.com [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/
RewriteRule ^(.*)$ http://www.domain.com [L,R=301]

# force https
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,qsappend,L]

我该怎么做

谢谢凯文

最佳答案

我自己找的

# force https
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !data/push-send [NC]
RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,qsappend,L]

凯文

关于http - .htaccess 强制 https 但只有一个页面带有 http 或 https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41544306/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com