Jump to content

301 redirect from http to https or not?


Recommended Posts

Hello, if i move my forum from http to https, using those instructions: https://invisionpower.com/news/avoiding-google-security-warnings-r996/, a 301 redirect from all pages with http to https should not be done (for SEO purposes)?

Something like:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

should do the redirect, right?

What do you advise me to do?
Thank you!

Link to comment
Share on other sites

Hi gaby!

I would say yes, do the redirect. I've done a few of my sites recently due to the recommendations and found quite a few additional things to do besides changing the board URL in global config and enabling the remote image caching feature. Remember to back up your site files and database first before making any changes.

Here's my htaccess in my root folder, ignore the second block if you don't want to redirect from www to non-www.

#Force https:
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^mysite\.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://mysite.com/$1 [R,L]

#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mysite\.com [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule ^(.*)$ https://mysite.com/$1 [L,R=301]

Secondly you will probably want to go to Google Search Console and make sure you have 4 Properties for your site as per Google's guidance, although it seems a bit overkill. Google may possibly ask you to verify any new Properties/Domains.

http://

http://www

https://

https://www

You can now also group them together after you have created any missing ones. Set your preferred version of https property for your website (either the www or non-www version).

Afterwards, you will get a message from Google confirming the change.

Then remove your sitemaps from the old http Property and add new ones to your preferred https Property (non-www or www version).

Remember to link your new Properties with your Google Analytics accounts, as needed.

Another extra step I decided to do was to run some database queries in AdminCP to search for and replace any non-https absolute URLs to images and pages in my site (and eventually for external sites) to avoid broken padlock/ mixed content warning messages. I was amazed to find the odd hard-coded absolute http URLs for Gallery content (album images etc) on the Gallery main index page, for example.

I also found some non-https links in my headers etc which needed changing to https.

This website was a handy tool for tracking them down:

https://www.whynopadlock.com

Also, you may need or want to update any links in your menu configuration and any forum images in your forum descriptions.

Hope this helps. ?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...