HTTPS 例外
HTTPS with exception
我正在努力找出对我的网站来说最好的行动方案。
问题是除了特定文件夹外,我希望网站上的所有地方都使用 HTTPS。
我不太确定需要进行哪些更改或需要进行哪些更改。
我当前的选项-ssl-apache.conf如下:http://pastebin.com/7AcK8SNh
我当前的 000-default-le-ssl.conf 如下:http://pastebin.com/HWaT2Z0Q
我考虑过的一个选项是让我的 apache 托管两个站点,一个在使用 SSL 的端口 80 上,另一个在端口 8080 上,只包含不需要 HTTPS 的文件夹。
有问题的文件夹是一个文件夹,其中包含客户端连接到我的游戏服务器时下载的文件,因此如果我只是将它托管在另一个端口上就不会有问题,因为我只是告诉游戏从 8080 下载文件.
修改此:
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
对此:
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteCond %{REQUEST_URI} !^/path/to/folder
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
应该排除 http://www.example.com/path/to/folder/anything
被重定向到 https://
我正在努力找出对我的网站来说最好的行动方案。
问题是除了特定文件夹外,我希望网站上的所有地方都使用 HTTPS。
我不太确定需要进行哪些更改或需要进行哪些更改。
我当前的选项-ssl-apache.conf如下:http://pastebin.com/7AcK8SNh
我当前的 000-default-le-ssl.conf 如下:http://pastebin.com/HWaT2Z0Q
我考虑过的一个选项是让我的 apache 托管两个站点,一个在使用 SSL 的端口 80 上,另一个在端口 8080 上,只包含不需要 HTTPS 的文件夹。 有问题的文件夹是一个文件夹,其中包含客户端连接到我的游戏服务器时下载的文件,因此如果我只是将它托管在另一个端口上就不会有问题,因为我只是告诉游戏从 8080 下载文件.
修改此:
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
对此:
RewriteEngine on
RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteCond %{REQUEST_URI} !^/path/to/folder
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
应该排除 http://www.example.com/path/to/folder/anything
被重定向到 https://