简体   繁体   English

如何将域从 http 重定向到 https

[英]How can I redirect an domain from http to https

I have an hosting with ipage and I have 5 domains on this hosting.我有一个带有 ipage 的主机,我在这个主机上有 5 个域。 My master domain is called eroups.com, and I already bought ssl for it but when I ask my hosting support to redirect it from http to https all my domains are redirecting to https and I don't have ssl for them yet.我的主域被称为eroups.com,我已经买了SSL的,但是当我问我的主机支持它重定向httphttps我所有的域重定向到https和我没有SSL他们呢。

And I make for this other each domain folder as redirect into this folder please if some one know how to fix that I just need to redirect eroups.com to https only and other same like http .如果有人知道如何解决我只需要将 eroups.com 重定向到https和其他类似http问题,我会将每个域文件夹重定向到这个文件夹。

My domains are:我的域是:

  • eroups.com (this is the master and have ssl) eroups.com(这是主人并且有ssl)
  • imolawigs.com imolawigs.com
  • imolagallery.com imolagallery.com
  • kittyshoping.com kittyshoping.com
  • kittywedding.com kittywedding.com

Please someone write the code for me I can't understand how to make that by myself and support didn't understand anything also.请有人为我编写代码,我无法理解如何自己编写代码,支持人员也一无所知。

so basically there are 4 main steps:所以基本上有4个主要步骤:

  1. update the url in your database http://yourdomain.net -> https://yourdomain.net更新数据库中的 url http://yourdomain.net -> https://yourdomain.net
  2. set a http to https redirect in your .htaccess file在您的 .htaccess 文件中设置 http 到 https 重定向
  3. check for any hardcoded http://yourdomain.net occurrences in the source files of your theme检查主题源文件中是否存在硬编码的http://yourdomain.net
  4. check for external resources which are loaded via http://.... (fonts, images, ...) and correct them to https://检查通过 http://...加载的外部资源(字体、图像等)并将它们更正为 https://

Do you have some programming skills?你有一些编程技巧吗? Then I could sent you the tools and code snippets which you can use to accomplish the transition from http to https.然后我可以向您发送工具和代码片段,您可以使用它们来完成从 http 到 https 的转换。

Unfortunately this process can not be automated by a plugin.不幸的是,这个过程不能通过插件自动化。

Cheers, Dominik干杯,多米尼克

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

If you don't want to code/touch your servers, you can achieve this without writing any code only by using a CDN for example if using Cloudflare: How do I redirect all visitors to HTTPS/SSL?如果您不想编码/接触您的服务器,则可以仅通过使用 CDN 来实现这一点,而无需编写任何代码,例如,如果使用 Cloudflare: 如何将所有访问者重定向到 HTTPS/SSL? . .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM