重定向到文件夹和https的所有请求?

时间:2019-03-22 22:13:59

标签: php apache .htaccess bolt-cms

我正在使用带有htaccess的bolt-cms将URL的根目录重定向到/ public文件夹。现在,我需要将http重定向到https。如何连接这两个规则?

这是我的htaccess:

RewriteEngine On

RewriteBase /
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC]
RewriteRule ^ %1 [L,NE,R=301]
RewriteRule ^((?!public/).*)$ public/$1 [L,NC,QSA]

RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.mecanalisis.com.ar%{REQUEST_URI} [L,NE,R=301]

0 个答案:

没有答案