从https://example.com在htacess重定向到https://www.example.com

编程入门 行业动态 更新时间:2024-10-23 20:27:09
本文介绍了从example在htacess重定向到www.example的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我与SSL进行www.example网站。我已成立了一个htaccess的重定向,它把从example => www.example用户。 如果我进入www.example那么它的工作原理。但是,如果我进入example然后它给了我一个SSL错误。

我如何重定向example到www.example而不显示SSL错误?

我用我的htaccess的重定向以下code。

的RewriteCond%{HTTP_HOST}!^ WWW \。 (。*)重写规则^ $ HTTP://www.% {HTTP_HOST} / $ 1 [R = 301,L]

解决方案

这是关系到你的SSL设置,可能它不是(* .domain)设置如果是这样(www.domain)没有问题任何错误。

www.domain!= domain

由于 WWW 的子域,即重定向到( domain ),那么,你需要启用SSL对( *。domain ),或者只是为( www.domain )所建议的@Jack

I have a website with the ssl for www.example. I have set up a htaccess redirect which redirects the user from example => www.example. If I enter www.example then it works. But if I enter example then it gives me a ssl error.

How do I redirect example to www.example without showing the ssl error?

I use the following code in my htaccess to redirect.

RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ www.%{HTTP_HOST}/$1 [R=301,L]

解决方案

This is related to your SSL setup, probably its not set for (*.domain) if so (www.domain) doesn't issues any error.

www.domain != domain

Because www is subdomain, that redirected to (domain), then, you need to enable SSL for (*.domain) or just for (www.domain) as suggested by @Jack

更多推荐

从https://example.com在htacess重定向到https://www.example.com

本文发布于:2023-11-01 11:39:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549243.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   https   htacess   www

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!