0

I need HTTPS for security and because it's a browser standard and I need a CNAME DNS record and a www wildcard redirect in my .htaccess file for a certain CDN.

I get about 2 seconds delay in a Google Page Speed Insights (GPSI) test due to not avoiding the following multiple redirects:

  • http://example.com (630 ms) →
  • https://example.com (480 ms) →
  • http://www.example.com (630 ms) →
  • https://www.example.com (480 ms) →

How to avoid multiple redirects in a Content Management System (CMS) agnostic way?

Update

  • I think that the HTTP to HTTPS redirect was automatically created by LetsEncrypt.
  • I did create the following wildcard redirect in my .htaccess file after being instructed to do so by a hosting provider's staff member:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
2
  • Redirects usually have very little to do with your content management system. They are usually implemented in web server configuration files outside of the content management system. Sometimes they are implemented through a control panel with your DNS settings. How have you actually implemented these redirects? Commented Feb 12, 2021 at 18:07
  • @Semo If you've lost your "cookie" then you may be able to get a mod to merge your accounts? Unfortunately, by appearing as a "different user" with just 1 rep, then you are not going to be able to interact with this question further.
    – MrWhite
    Commented Feb 13, 2021 at 1:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.