Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Concrete5在系统页面上强制SSL_Php_.htaccess_Ssl_Concrete5 - Fatal编程技术网

Php Concrete5在系统页面上强制SSL

Php Concrete5在系统页面上强制SSL,php,.htaccess,ssl,concrete5,Php,.htaccess,Ssl,Concrete5,我正在使用强制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

我正在使用强制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 --
重新编写引擎打开
RewriteCond%{HTTP_HOST}^和平学校\.net$[或]
重写COND%{HTTP_HOST}^www\.peacleschools\.net$
重写规则^/?$“http\:\/\/和平学校\.com\/”[R=301,L]
#使用PHP54 Single php.ini作为默认值
AddHandler应用程序/x-httpd-php54s.php
#--从5个URL开始--
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}/index.html-F
重写cond%{REQUEST_FILENAME}/index.php-F
重写规则。index.php[L]
#--结束--

无论是否使用插件,我如何在登录页面的URL中获取https?

如果您不使用插件或通过php,您应该能够在htaccess中实现这一点。看看这对你是否有效

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !^on$  
RewriteCond %{REQUEST_URI} ^/login 
RewriteRule ^(.*)$ https://www.peacefulschools.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^peacefulschools\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.peacefulschools\.net$
RewriteRule ^/?$ http://www.peacefulschools.com/ [R=301,L]


# Use PHP54 Single php.ini as default
AddHandler application/x-httpd-php54s .php

# -- concrete5 urls start --
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
# -- concrete5 urls end --

它仍然没有显示,但我想这是因为我在.htaccess中有其他东西。我将把它添加到我的问题中。你觉得怎么样?试试这个更新的htaccess,看看它是否适合你。谢谢你的回复!它对我仍然不起作用:(如果我输入peacetschools.com/login,它会重写到。我试图看看如果我删除了“concrete5 URL开始”之间的所有重写条件,会发生什么情况)评论…然后它确实重定向到,但有一个bluehost page not found错误。想法?顺便说一句,我仍然安装了插件,因为它可以很容易地重定向到我们的电子商务页面上的https。您无法找到页面,因为您的URL看起来应该是
https://www.peachfulschools.com/index.php/login
请尝试添加登录重定向规则之前,在
index.php
中。