: Migrating from HTTP-https with previous canonical to http to now full HTTPS Let’s say I have a site at: http://www.example.com That is also available at: https://www.example.com - but this version
Let’s say I have a site at: www.example.com That is also available at: www.example.com - but this version was never used, I.e. canonicals pointing to http.
My new site is: www.example.com/en
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?
Because previously the https version had canonicals pointing to http, what implications could this possible cause, if any?
More posts by @Steve110
3 Comments
Sorted by latest first Latest Oldest Best
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.
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:
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 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.
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.
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 example.com Redirect / www.example.com/ </VirtualHost>
<VirtualHost *:443>
ServerName example.com # ... SSL configuration goes here
</VirtualHost>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.