【发布时间】:2014-02-27 00:46:28
【问题描述】:
我正在使用 Force SSL 插件,需要使我的登录页面具有 SSL。我不希望其他页面有 SSL。在哪里为 force SSL 插件启用此功能?
我也尝试将以下内容编程到登录模板中,但即使我还在 /config/site.php 中放入了 define('REDIRECT_TO_BASE_URL', false),它也会导致重定向循环:
$redirect= "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location:$redirect");
我还尝试将以下内容放入 .htaccess 中,但导致找不到页面:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} login
RewriteRule ^(.*)$https://www.peacefulschools.com/login/$1 [R,L]
我当前的 .htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^peacefulschools\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.peacefulschools\.net$
RewriteRule ^/?$ "http\:\/\/peacefulschools\.com\/" [R=301,L]
# Use PHP54 Single php.ini as default
AddHandler application/x-httpd-php54s .php
# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --
无论是否使用插件,我如何才能在登录页面的 URL 中获取 https?
【问题讨论】:
标签: php .htaccess ssl concrete5