Welcome to Centmin Mod Community
Register Now

Need Help With Redirect Chains https www

Discussion in 'Blogs & CMS usage' started by UsmanGTA, Jun 22, 2018.

  1. UsmanGTA

    UsmanGTA New Member

    Sep 14, 2017
    Local Time:
    7:46 PM
    Hi Centmin Community,

    Ever since I installed centmin, I delighted when it comes to speed tests. However, I have noticed that the move to https has messed up with Google's rankings. It has been seven months since and I am still waiting for it to be fixed. I was recommended to look at a redirect chain that my website has. I'm looking to remove it and make it much simper. Could you help me?

    When I installed Wordpress with Option 24 I had LetsEncrypt=Y in my custom config as well as used geeksultd.com (without www.) at the time of Wordpress installation.

    What do I edit here? The current redirect chain is as follows

    My wordpress site address and url address is Home

    I want to make it redirect from Home to Home

    I'm not sure which Nginx file is necessary to edit, but here's one of the portions I picked up from

    server {

    server_name geeksultd.com www.geeksultd.com;
    return 302 https://geeksultd.com$request_uri;
    include /usr/local/nginx/conf/staticfiles.conf;

    server {
    listen 443 ssl http2;
    server_name geeksultd.com www.geeksultd.com;

    include /usr/local/nginx/conf/ssl/geeksultd.com/geeksultd.com.crt.key.conf;
    include /usr/local/nginx/conf/ssl_include.conf;

    Any help would be greatly appreciated.

  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    9:46 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Posted at centminmod.com/nginx_domain_dns_setup.html#httpsredirect is the correct way to set it up - pay attention to different way if you want redirect target being www version instead of non-www and vice versa and that the target version www or non-www is the only version listed in server_name for the 2nd/main server {} context.

    key to testing is using 302 temp redirect first in a private incognito browser session otherwise the problems you can experience may end up being due to browser caching or 301 permanent redirects unless you clear browser cache and reboot local computer(s) and even then some web browsers don't let go of 301 permanent redirect browser cache that willingly :)

    You can test in SSH via curl to check headers for location field (where the redirect goes) using the following commands:
    Code (Text):
    curl -I http://domain.com

    Code (Text):
    curl -I http://www.domain.com