How to avoid SSL warnings about certificate not for the current site when redirecting alternate domains?

by johnsnow   Last Updated March 01, 2018 11:04 AM

I have multiple domains forward issue. Domains with plurals and singular e.g.:

  • example.com,
  • examples.com,
  • example.biz,
  • examples.biz

I forwarded all of them to https://examples.com and https://www.examples.com but ran into web browser warnings about someone could intercept communications as the SSL cert issued is not for the current website I visited. I have SSL cert for https://examples.com and https://www.examples.com

What is the best solution for this?



Answers 1


Well, at first sight, it seems like you have issued an SSL certificate which you have installed in another domain and this will certainly trigger these warnings.

And you are not telling us which method you used to redirect the domains, there are ways to redirect the domains directly from your DNS panels, or with .htaccess files, or by using a Meta Command in the MySQL DB, or even by making a .php script for the redirection.

My opinion is that you should use

  1. DNS redirect
  2. .htaccess 301 redirects.

In case A you just add a redirect to the domains you want from within the DNS panel at your Domain registrar. This is the simplest and easiest solution.

Then you check again your SSL certificates and after that, you had to make sure that you have purchased the SSL for the right domain, i suggest to install it again.

And that's it.

Now if you want to use the redirect with the .htaccess file you have to NOT redirect your domains from the DNS panel of your registrar to the other domain, but point them in your webserver, in which you will have created the necessary webspace for their hosting, and then you will edit the .htaccess file.

Then you will open the root folder, in the webserver, in the webspace of the domain that is to be redirected, and If no .htaccess exists in your root folder currently, you can create one using an application like Notepad (or a similar plain text application).

The code for the file is contained in the next step. Make sure that when you save your .htaccess file it begins with a “.” Note that this file has no tail extension (e.g. “.com” or “.txt”)

Paste the following code into the .htaccess text file: .redirect 301 /old/oldURL.com http://www.newURL.com In the code, oldURL.com represents the landing page address your visitors will need to be redirected from while http://www.newURL.com represents the address you'd like your visitors redirected to. There should be exactly one blank space between oldURL.com and http:// Don't add http://www to the (old) URL in the first part of the code!

The code "301" is most commonly used on redirected sites and means "moved permanently".

Theodor_D
Theodor_D
March 01, 2018 10:30 AM

Related Questions



nginx http to https redirect - just isn't working

Updated March 08, 2018 06:04 AM


Webpage is Showing "Not Secure" in Chrome

Updated October 20, 2017 05:04 AM

HTTPS works, but loads up a different site

Updated December 26, 2017 15:04 PM