HTTPS redirecting to wrong site

My domain is: australia.franchise-association.org
I ran this command: visit https in web browser
It produced this output: redirects to argentina.franchise-association.org
My web server is (include version): Apache
The operating system my web server runs on is (include version): Ubuntu
My hosting provider, if applicable, is: Digitalocean (self hosted)
I can login to a root shell on my machine (yes or no, or I don't know):Yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): No just terminal
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 0.40.0

--

I am attempting to set up letsencrypt SSL for 40 domains.
I have ran a DNS challenge on *.franchise-association.org
The SSL works fine for argentina.franchise-association.org, but every other subdomain redirects to that, such as australia.franchise-association.org and the others i'm beginning to set up.

I ran the command certbot install, and installed the virtual hosts for australia and argentina , which now appear in the Apache sites-available directory as australia-le-ssl.conf etc.

When prompted whether 1 no redirect or 2 redirect, I chose 2, to ensure that HTTPS is maintained.

Unfortunately, all sites are redirecting to the first virtualhost, which is Argentina.

This is my SSL vhost for Australia which appears to redirect to Argentina.

<IfModule mod_ssl.c>
<VirtualHost *:443>
        ServerAdmin matt@(removed for forum)
        ServerName australia.franchise-association.org
        ServerAlias www.australia.franchise-association.org
        DocumentRoot /var/www/australia

        <Directory /var/www/australia/>
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        </IfModule>


SSLCertificateFile /etc/letsencrypt/live/franchise-association.org/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/franchise-association.org/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

As far as my sites are concerned, they're set up with the correct database details etc in wp-admin.
Its only until the SSL was installed, that they redirect to argentina.

Thanks for any assistance.

2 Likes

Hi @mburdett555

there is no redirect visible - see https://check-your-website.server-daten.de/?q=australia.franchise-association.org#url-checks

Domainname Http-Status redirect Sec. G
http://australia.franchise-association.org/ 178.62.20.11 GZip used - 7802 / 34273 - 77,24 % 200 Html is minified: 162,49 % 0.147 H
https://australia.franchise-association.org/ 178.62.20.11 GZip used - 7805 / 34317 - 77,26 % Inline-JavaScript (∑/total): 14/3512 Inline-CSS (∑/total): 4/6636 200 Html is minified: 162,44 % 2.607 I

http status 200 -> not 301/302 etc.

Same checked with my browser, no redirect.

So it's only a local problem of your browser cache -> clear it.

PS: Checked both subdomains in my browser. There is different content - australia has an empty WordPress, Argentina has content

Quality Franchise Association Argentina is a trade association that assists both franchise businesses & individuals that are interested in franchising to start their own business.

3 Likes

Cheers, yes all working. Apologies for wasting your time lol, I should have checked that on another device.

4 Likes

Yep, to check redirects, browsers are terrible, too much caching. Use online tools, they start new.

3 Likes

Yep. I use this one quite a lot:

https://www.redirect-checker.org

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.