开发者

htaccess and SSL proxy

My new host is using SSL with proxy, on my old hosts I could use this rules in 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

But this does not work on my new host with SSL proxy I tried the following but no luck:

#new host
Options +FollowSymLinks
RewriteEngine 开发者_运维问答On
RewriteBase /folder
RewriteCond %{HTTP:X-SSLproxy} !Yes
ErrorDocument 403 https://www.website.eu/folder

How can I make this work?

Thanks!


Use this instead of the ErrorDocument line:

RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

I don't think it works if you are using Apache authentication though, the rewrite happens after the auth.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜