Url redirecting to webmail

After adding my site to Cloudflare www.mydomain.com and mydomain.com redirects to webmail.mydomain.com…it only works well when accessed with https://mydomain.com

Since you’re using HTTPS, make sure you use the Dashboard’s Crypto section to enable “Always Use HTTPS” and “Automatic HTTPS Rewrites.”

Yes its on already…it started redirecting just recently

What’s the domain?

www.afrosages.com try it on your phone browser

I’m on an iPad right now and that link sends me to your website. Why would it matter to use a mobile browser?

yes it shouldn’t matter and that is the problem now…my client contacted me and told him same…i tried on my iphone and i got the redirect…i just dont get it but when i disable or pause Cloudflare there is no redirect…just dont see the problem

Hi @kingsleymensah,

Yes, your site is redirecting from www. to webmail. subdomain when hit with some mobile user agents. Testing it on https://aw-snap.info/file-viewer/ and using no referrer and either iPhone or Windows Mobile user agents it does redirect to the webmail. subdomain.

The only Cloudflare feature that could cause this (unless this is a bug) would be the Cache by Device Type, which is a Page Rule setting only available to Enterprise Plan users. A misconfigured DNS record could also cause the redirect, but it wouldn’t differentiate between user agents.

I’d suggest you Purge Everything on Cloudflare and clear all other origin caches you may have, see if that makes the issue go away.

Otherwise, you’d need to check your origin server configuration to make sure it doesn’t have any user-agent-based redirects on .htaccess (or equivalent config file in case your server is not running Apache) or in the WordPress installation. Some caching plugins offer to generate and cache different pages based on device type. Perhaps you’ve set this while testing a plugin and forgot to remove this option.

2 Likes

Hi @kingsleymensah,

Using redirect-checker.org:
DESKTOP:

>>> http://www.afrosages.com/

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status:	301 Moved Permanently
Code:	301
Date:	Sun, 07 Jul 2019 18:43:54 GMT
Connection:	close
Cache-Control:	max-age=3600
Expires:	Sun, 07 Jul 2019 19:43:54 GMT
Location:	https://www.afrosages.com/
Server:	Cloudflare
CF-RAY:	4f2bf77b4b92d71d-FRA




>>> https://www.afrosages.com/

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status:	301 Moved Permanently
Code:	301
Date:	Sun, 07 Jul 2019 18:43:55 GMT
Content-Type:	text/html; charset=UTF-8
Connection:	close
Set-Cookie:	__cfduid=de3cb24aa57b8711a82ab3aaedf69f0391562525034; expires=Mon, 06-Jul-20 18:43:54 GMT; path=/; domain=.afrosages.com; HttpOnly; Secure
Cf-Railgun:	direct (starting new WAN connection)
Location:	https://afrosages.com/
Referrer-Policy:	no-referrer-when-downgrade
X-Litespeed-Cache:	hit
X-Powered-By:	PHP/7.2.19
X-Redirect-By:	WordPress
X-Turbo-Charged-By:	LiteSpeed
Expect-CT:	max-age=604800, report-uri="https://report-uri.Cloudflare.com/cdn-cgi/beacon/expect-ct"
Server:	Cloudflare
CF-RAY:	4f2bf77c4fbbd705-FRA




>>> https://afrosages.com/

> --------------------------------------------
> 200 OK
> --------------------------------------------

Status:	200 OK
Code:	200
X-Powered-By:	PHP/7.2.19
Content-Type:	text/html; charset=UTF-8
Link:	</min/66885.css>; rel=preload; as=style,</min/71d2a.css>; rel=preload; as=style,</min/55cf3.css>; rel=preload; as=style,</min/e5a99.css>; rel=preload; as=style,</min/7a735.css>; rel=preload; as=style,</min/af845.css>; rel=preload; as=style,</min/abde0.css>; rel=preload; as=style,</min/c42f6.css>; rel=preload; as=style,</min/bb897.css>; rel=preload; as=style,</min/606a4.js>; rel=preload; as=script,</min/44d8b.js>; rel=preload; as=script,</min/f232a.js>; rel=preload; as=script,</min/ef988.js>; rel=preload; as=script,</min/6ddf0.js>; rel=preload; as=script,</min/7decf.js>; rel=preload; as=script,</min/a6e1b.js>; rel=preload; as=script,</min/82300.js>; rel=preload; as=script,</wp-content/plugins/litespeed-cache/js/webfontloader.min.js>; rel=preload; as=script
Etag:	"20577-1562524909;;;"
X-LiteSpeed-Cache:	hit
Date:	Sun, 07 Jul 2019 18:43:56 GMT
Server:	LiteSpeed
Referrer-Policy:	no-referrer-when-downgrade
Alt-Svc:	quic=":443"; ma=2592000; v="35,39,43,44"
Connection:	close

MOBILE:

>>> http://www.afrosages.com/

> --------------------------------------------
> 302 Moved Temporarily
> --------------------------------------------

Status:	302 Moved Temporarily
Code:	302
Date:	Sun, 07 Jul 2019 18:43:15 GMT
Connection:	close
Cache-Control:	private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires:	Thu, 01 Jan 1970 00:00:01 GMT
Location:	http://webmail.afrosages.com/
Server:	Cloudflare
CF-RAY:	4f2bf6840f20d705-FRA




>>> http://webmail.afrosages.com/

> --------------------------------------------
> 301 Moved Permanently
> --------------------------------------------

Status:	301 Moved Permanently
Code:	301
Location:	https://webmail.afrosages.com/
Content-Type:	text/html; charset="utf-8"
Cache-Control:	no-cache, no-store, must-revalidate, private
Content-Length:	114
Date:	Sun, 07 Jul 2019 18:43:16 GMT
Server:	LiteSpeed
Connection:	close




>>> https://webmail.afrosages.com/

> --------------------------------------------
> 200 OK
> --------------------------------------------

Status:	200 OK
Code:	200
Content-Type:	text/html; charset="utf-8"
Cache-Control:	no-cache, no-store, must-revalidate, private
Pragma:	no-cache
Set-Cookie:	roundcube_cookies=enabled; HttpOnly; expires=Mon, 06-Jul-2020 18:43:16 GMT; path=/; port=443; secure
Content-Length:	36816
Date:	Sun, 07 Jul 2019 18:43:17 GMT
Server:	LiteSpeed
Alt-Svc:	quic=":443"; ma=2592000; v="35,39,43,44"
Connection:	close

Can you check that under image in your Cloudflare dashboard that:

is set to off?

I have seen similar cases here before where that setting is causing the redirect.

3 Likes

i checked the mobile redirect under speed and it was turned on. i guess it has to be off right?

1 Like

Yes. Off. You don’t want mobile visitors to your site being sent to webmail instead.

yes it works now…thanks a lot

2 Likes

This topic was automatically closed after 14 days. New replies are no longer allowed.