Cloudflare subdomain redirecting to main domain
Any idea why my subdomain keeps redirecting to main domain? Opened a cloudflare ticket, been 14 days and no response
https://fr.ellasbubbles.ca/ -> Keeps redirecting to https://ellasbubbles.com/
My research makes it seem like its a problem with the SSL certificate9 Replies
When I disable SSL, the redirect no longer occurs - but I receive a privacy error obviously. So this is SSL related
You can tell from the Response Headers that it's from Wordpress (the CF-Cache-Status means from origin, and X-Redirected-By Wordpress means... wordpress)
I believe wordpress just automagically redirects you to the configured site home/url if the url is different hostname then it
//* Secure Multi Domain
if($_SERVER['HTTP_HOST'] == 'ellasbubbles.mx' $_SERVER['HTTP_HOST'] == 'ellasbubbles.ca' $_SERVER['HTTP_HOST'] == 'fr.ellasbubbles.ca' $_SERVER['HTTP_HOST'] == 'ellasbubbles.fr' $_SERVER['HTTP_HOST'] == 'ellasbubbles.de' $_SERVER['HTTP_HOST'] == 'ellasbubbles.lv' $_SERVER['HTTP_HOST'] == 'ellasbubbles.it' $_SERVER['HTTP_HOST'] == 'ellasbubbles.uk' $_SERVER['HTTP_HOST'] == 'ellasbubbles.se'){
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
}
define('DISALLOW_FILE_MODS',false);
define( 'WPE_GOVERNOR', false );
define('WP_AUTO_UPDATE_CORE', 'minor');
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
define( 'WP_CONTENT_URL', 'https://' . $_SERVER['HTTP_HOST'] . '/wp-content');
define('CODE_SNIPPETS_SAFE_MODE', false);
define('WP_MEMORY_LIMIT', '512M');
wp.config is initialized to handle this
Htaccess is restored to default
I don't know wordpress enough to help, all I can tell you is that the response header indicates wordpress is doing it. If you still believed it was Cloudflare you could disable proxy on the subdomain, or use curl with resolve override to test it locally on the web server, ex:
curl --resolve fr.ellasbubbles.ca:443:127.0.0.1 https://fr.ellasbubbles.ca/ -k -vvv
Proxy Disabled, still redirecting
When I disable the Universal SSL on cloudflare however, the redirect does not happen....
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 18 Jul 2023 16:04:05 GMT
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Disabled-plugins: 0 on 2023-07-18 04:04:06
< X-Redirect-By: WordPress
< Set-Cookie: wcml_client_currency=USD; expires=Thu, 20-Jul-2023 16:04:05 GMT; Max-Age=172800; path=/; secure
< Set-Cookie: wcml_client_currency_language=en; expires=Thu, 20-Jul-2023 16:04:05 GMT; Max-Age=172800; path=/; secure
< Set-Cookie: PHPSESSID=00de3396c51030561c356a0ada285117; path=/; secure; SameSite=None
< Set-Cookie: wcml_client_country=US; expires=Thu, 20-Jul-2023 16:04:05 GMT; Max-Age=172800; path=/; secure
< Location: https://ellasbubbles.com/
< Vary: User-Agent,Accept-Encoding
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
Yea, sadly all that does is re-enforce it's not Cloudflare, it's your web server redirecting at least https requests to .com
and it works, or gives a different error? It's possible for example your origin doesn't do the redirect on http, or something else