1

Let’s say I have a site at: http://www.example.com That is also available at: https://www.example.com - but this version was never used, I.e. canonicals pointing to http.

My new site is: https://www.example.com/en

  1. Do I need to redirect all URLs from HTTP and HTTPS versions separately? Or can a regex rewrite be used to deal with this, as both share the same old structure?

  2. Because previously the https version had canonicals pointing to http, what implications could this possible cause, if any?

1

You can handle this in 2 ways.

Method 1: Redirect all your traffic to HTTPS version of your preferred URL. If you do this then you don't need to set canonical in general.

Method 2: If you may have difficulty in redirecting all other versions of your URL to your preferred HTTPS then do best with redirection and set canonical to your preferred https version.

Method 1 looks cleaner for users as well as bots.

But if your website may be producing lots of duplicate content then you will need to use both method 1 and method 2 for the best desired result.

| improve this answer | |
0

I'm not sure what you're using as a webserver, but as I am only familiar with Apache, provided that's what you're using I recommend the following in your Apache config file:

<VirtualHost *:80>
   ServerName www.example.com
   Redirect / https://www.example.com/
</VirtualHost>

<VirtualHost *:443>
   ServerName www.example.com
   # ... SSL configuration goes here
</VirtualHost>
| improve this answer | |
0

I presume that Google has already indexed the first HTTP version of the website, ignoring all pages from the HTTPS. That being said and from the SEO perspective:

  1. You don't need to redirect the OLD HTTPS version to the NEW HTTPS/Folder. You only need to redirect the HTTP version Only (http://www.example.com). However, you might check if there is any link pointing to the OLD https://www.example.com you will need to Redirect only that page. REGEX: Sometimes a simple 301 redirect instruction from root to directory taking into account inner pages (apache or nginx server) will be sufficient. Yes definitely use Regex here.

  2. It won't cause any issue. As I said before, the only drawback would be potential lost of a link pointing to the OLD HTTPS. In this case you need to 301 the linked page to the new version.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.