【发布时间】:2016-06-21 21:39:28
【问题描述】:
我有这个 htaccess:
RewriteBase /
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/my
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/my
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
DirectoryIndex index.php index.cgi index.html
ErrorDocument 401 /errors/401.php
ErrorDocument 403 /errors/403.php
ErrorDocument 404 /errors/404.php
#### PERSISTENT CONTENT ####
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ zyro/$1 [L,QSA]
我想知道如何保持此代码正常工作并添加 HTTP-HTTPS 重定向,感谢任何帮助。谢谢你
【问题讨论】:
-
你想让所有的http请求都转到https吗?
-
是的,正如你所说的
标签: apache .htaccess http https