Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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
.htaccess htaccess和SSL代理_.htaccess_Ssl_Proxy - Fatal编程技术网

.htaccess htaccess和SSL代理

.htaccess htaccess和SSL代理,.htaccess,ssl,proxy,.htaccess,Ssl,Proxy,我的新主机使用SSL和代理,在我的旧主机上,我可以在htaccess中使用以下规则: #old host Options +FollowSymLinks RewriteEngine On RewriteBase /folder SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq "www.website.eu" ErrorDocument 403 https://www.website.eu/folder 但这

我的新主机使用SSL和代理,在我的旧主机上,我可以在htaccess中使用以下规则:

#old host
Options +FollowSymLinks
RewriteEngine On
RewriteBase /folder

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "www.website.eu"
ErrorDocument 403 https://www.website.eu/folder
但这在使用SSL代理的新主机上不起作用。我尝试了以下方法,但没有成功:

#new host
Options +FollowSymLinks
RewriteEngine On
RewriteBase /folder
RewriteCond %{HTTP:X-SSLproxy} !Yes
ErrorDocument 403 https://www.website.eu/folder
我怎样才能做到这一点


谢谢

使用该行而不是ErrorDocument行:

RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
但是,我认为如果您使用Apache身份验证,那么它不起作用,重写是在身份验证之后进行的

离题。请仔细阅读。