当前第2页 返回上一页
第三、补充301跳转,两种规则同时配置
1 2 3 4 5 | RewriteEngine On
RewriteCond %{HTTP_HOST} !^cainiaoqidian.com$ [NC]
RewriteRule ^(.*)$ https://cainiaoqidian.com/$1 [L,R=301]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://cainiaoqidian.com/$1 [L,R=301]
|
如果我们有朋友喜欢用不带WWW的格式,所以我们也可以强制不带WWW跳转和HTTPS强制不带WWW。
1 2 3 | RewriteEngine on
RewriteCond %{HTTP_HOST} ^cainiaoqidian\.com [NC]
RewriteRule ^(.*)$ http://cainiaoqidian.com/$1 [L,R=301,NC]
|
以上就是apache同时配置301和https跳转的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
Apache可以解析php吗
Apache服务器安装锐安信ssl证书教程
Apache http server是什么意思
Apache将http重定向到https
Apache怎么设置环境变量
Apache文件夹能删吗
如何将Apache和php整合在一起
Apache打不开php文件
Apache怎么读音 是什么
ubuntu怎么安装Apache
更多相关阅读请进入《Apache》频道 >>
转载请注明出处:木庄网络博客 » apache同时配置301和https跳转