【发布时间】:2026-02-20 03:30:01
【问题描述】:
我有 https 的网站
但我需要具体的文件夹应该是http。
我们如何实现它?
例如 我的网站是
https://www.mywebsite.com
我想folder1/subfolder1应该被强制为http://
例如http://www.mywebsite.com/folder1/subfolder1
我在网上搜索...但最大搜索显示如何强制 http 到 https
我试过.htaccess如下:
try 1.
RewriteRule ^(/folder1/subfolder1)($|/) - [L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
try 2.
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/folder1/subfolder1
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
但它没有工作..
【问题讨论】:
-
你没有尝试过使用 .htaccess 吗?
-
@semira 是的,我试过了...请参阅编辑过的问题..
标签: .htaccess http ssl mod-rewrite https