• I have two sites: website.domain.com and domain.com. Both are physically on the same server. However the production site (domain.com) is enabled with HTTPS under Dashboard > Settings General. The website.domain.com has HTTP instead. Every time I enter “https://website.domain.com” in the browser, I get redirected to “https://domain.com”. Why is this? I’ve not set any .htaccess redirects neither are there any plugins doing this. I also checked the Apache configurations and there is nothing custom here. Here is what the access log and a curl command shows:

    xxx.xxx.xxx.xxx - - [11/Jan/2016:19:44:02 +0530] "GET / HTTP/1.1" 301 527 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
    xxx.xxx.xxx.xxx - - [11/Jan/2016:19:44:02 +0530] "GET / HTTP/1.1" 200 50425 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36"
    
    curl -vvv https://website.domain.com/
    
    * Hostname was NOT found in DNS cache
    *   Trying xxx.xxx.xxx.xxx...
    * Connected to website.domain.com (xxx.xxx.xxx.xxx) port 443 (#0)
    * successfully set certificate verify locations:
    *   CAfile: none
    ..
    ..
    ..
    > GET / HTTP/1.1
    > User-Agent: curl/7.35.0
    > Host: website.domain.com
    > Accept: */*
    >
    < HTTP/1.1 301 Moved Permanently
    < Date: Mon, 11 Jan 2016 14:15:13 GMT
    * Server Apache/2.4.16 (Ubuntu) is not blacklisted
    < Server: Apache/2.4.16 (Ubuntu)
    < Expires: Wed, 11 Jan 1984 05:00:00 GMT
    < Cache-Control: no-cache, must-revalidate, max-age=0
    < Pragma: no-cache
    < Location: https://domain.com/
    < Content-Length: 0
    < Content-Type: text/html; charset=UTF-8
    <
    * Connection #0 to host website.domain.com left intact
  • The topic ‘HTTPS website redirects to the main production site instead of the dev site’ is closed to new replies.