惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

Rat's Blog - ssl

使用Caddy申请免费的Let’s Encrypt泛域名SSL证书 - Rat's Blog Let’s Encrypt免费泛域名SSL证书申请教程 - Rat's Blog 一个可以免费申请Let's Encrypt和TrustAsia SSL证书的网站 - Rat's Blog 利用Caddy快速简单的部署反向代理/镜像,自动签发SSL证书 - Rat's Blog acme.sh:Let's Encrypt SSL证书自动签发脚本 - Rat's Blog MySSL:一个很详细的SSL测试工具网站 - Rat's Blog しらSSL:免费Alphassl泛域名证书申请 - Rat's Blog 分享一个SSL证书链补全工具,解决部分浏览器显示证书不可信的问题 - Rat's Blog 免费Alphassl泛域名SSL证书申请方法 - Rat's Blog
Apache环境强制http 301跳转https的方法 - Rat's Blog
博主: Rat's · 2017-08-18 · via Rat's Blog - ssl

说明:今天用服务器搭建了个Apache环境的站点,上SSL后,发现自己用惯了Nginx环境还不是很熟悉Apache301定向,就自己在网上找了下方法,发现只需要修改.htaccess文件即可,这里说一下。

关于Nginx环境301请看:Nginx环境强制http 301跳转https的方法Nginx环境开启ssl后强制https 301全部指向www的方法

方法

直接修改对应网站根目录的.htaccess配置伪静态文件就可以,没有这个文件的可以自建一个试试。

1、根目录域名

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

2、子目录

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} 子目录文件夹
RewriteRule ^(.*)$ https://www.yourdomain.com/子目录文件夹 [R,L]

将需要修改的修改下,填入.htaccess文件就可以了。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/259/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。