当前位置:Gxlcms > PHP教程 > 网站特定页面启用https

网站特定页面启用https

时间:2021-07-01 10:21:17 帮助过:7人阅读

环境:apache+ubuntu+php
目前需要在一个wordpress站点启用https,但不需要全站,只打算在登录和一个表单申请页面使用。
想问一下该如何配置。
谢谢。

回复内容:

环境:apache+ubuntu+php
目前需要在一个wordpress站点启用https,但不需要全站,只打算在登录和一个表单申请页面使用。
想问一下该如何配置。
谢谢。

用 apache 的 rewrite 处理一下,比如

RewriteCond %{HTTPS} =off [NC]
RewriteCond %{THE_REQUEST} /(login|register) [NC]
RewriteRule ^(login|register) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

人气教程排行