Home > Backend Development > PHP Tutorial > 网站特定页面启用https

网站特定页面启用https

WBOY
Release: 2016-06-06 20:38:34
Original
901 people have browsed it

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

回复内容:

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

用 apache 的 rewrite 处理一下,比如

<code>RewriteCond %{HTTPS} =off [NC]
RewriteCond %{THE_REQUEST} /(login|register) [NC]
RewriteRule ^(login|register) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template