Endless Redirect Loop (Premium SEO Pack and WPML conflict)


#1

Hi all,

One of my domain is unable to reload subdirectory such domain.com/en. It perfectly fine with domain.com?lang=en

I followed nearly all possible solutions. No luck. But at the end, I am pretty sure that it related to CloudFlare. Because of my test environment (which is exactly same configuration at the same server without CF)

The weirdest part is; the rule tries to reload another URL which is nonsense. You can try and see the activities at Chrome or Firefox console>network section. The URL is https://mira-aviation.com/en
By the way, Please do not waste your time to mention these solutions below :smile:




Thank you for your support.


#2

Looking at the loop I can’t think of a way where Cloudflare (apart from some custom page rule or worker script) would be the culprit here. The redirects are between subpaths which can be controlled only at the origin…

$ curl -I https://mira-aviation.com/en
HTTP/2 301 
date: Mon, 03 Dec 2018 22:21:17 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=deb4b858563269613bc8f362ec83d60191543875674; expires=Tue, 03-Dec-19 22:21:14 GMT; path=/; domain=.mira-aviation.com; HttpOnly
x-powered-by: PHP/7.2.12
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
set-cookie: PHPSESSID=ab74d441aa6e4941b1438e8d9b58d6bd; path=/
location: https://mira-aviation.com/en/product/citation-sovereign-2011/
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 48396cd5fc85be3e-MXP

$ curl -I https://mira-aviation.com/en/product/citation-sovereign-2011/
HTTP/2 301 
date: Mon, 03 Dec 2018 22:21:25 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=d0cfa62ccb79a94ad2d1be2d1bae9131e1543875684; expires=Tue, 03-Dec-19 22:21:24 GMT; path=/; domain=.mira-aviation.com; HttpOnly
x-powered-by: PHP/7.2.12
pragma: no-cache
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
set-cookie: PHPSESSID=f0104c4039c7966ee2b856f5ef350a4d; path=/
location: https://mira-aviation.com/en/product/citation-sovereign-2011-sn/
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 48396d124ac93db9-MXP

$ curl -I https://mira-aviation.com/en/product/citation-sovereign-2011-sn/
HTTP/2 301 
date: Mon, 03 Dec 2018 22:21:48 GMT
content-type: text/html; charset=UTF-8
set-cookie: __cfduid=dc21901bafd4c940d6933ec1d5a380d251543875707; expires=Tue, 03-Dec-19 22:21:47 GMT; path=/; domain=.mira-aviation.com; HttpOnly
x-powered-by: PHP/7.2.12
pragma: no-cache
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
set-cookie: PHPSESSID=7c99e04b2d97afbe980c55f3d2a6aeaf; path=/
location: https://mira-aviation.com/en/product/citation-sovereign-2011/
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 48396da2786dbe52-MXP

#3

Matteo, Thank you for your reply,

But what about our test environment. http://merll.com/mira-test/en
It is working fine with the exact same configuration except CloudFlare (and lets encrypt ssl)


#4

Do you have any Page Rules set up here?


#5

Yes sdayman, but I added for testing a solution. I can delete it.
http://*mira-aviation.com/*
Enforce HTTPS for this URL


#6

That shouldn’t be the cause. If you set the site to :grey:, does it still redirect?


#7

I tried to pause, but not tried to disable the dns.


#8

Pause Website basically does the same thing. I just go with :grey: because it’s quicker for me.


#9

So I can say yes :slight_smile: I tried the pause and tested with https://www.browserling.com/


#10

Would it be an issue letting the site be on :grey: for a few minutes?


#11

With it paused/bypassed, I’d test it and then look at the headers to make sure it’s not going through Cloudflare. I can’t see a reason bypassing Cloudflare would fix the problem. I think it’s a server configuration.


#12

of course not, I disabled the A records


#13

The issue is server-side…

$ curl -I --resolve mira-aviation.com:443:50.23.213.220 https://mira-aviation.com/en
HTTP/2 301 
date: Mon, 03 Dec 2018 23:42:29 GMT
server: Apache
x-powered-by: PHP/7.2.12
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
set-cookie: PHPSESSID=062ce19006803ab4f7412cf969320b96; path=/
location: https://mira-aviation.com/en/product/citation-sovereign-2011/
content-type: text/html; charset=UTF-8

#14

Thanks Matteo,
It gets weirder :slight_smile: then, because the duplicated one is working fine at the same server :slight_smile: with same PHP settings.


#15

Mmm maybe some weird .htaccess somewhere…


#16

I tried to delete it, recreate, restart apache, flushed the WP url cache from database etc. I was gave up on the idea that is related with the server actually.


#17

It’s somewhere there, though… I doubt there are issues in transit given the HTTPS there!


#18

I changed the page’s path to http:// to test if it is working without SSL, and it worked. you can reload without https

but interesting part is page rule supposed to force it t https (it started to force after a while… you can ignore this part.)


#19

Returns this for me though…

$ curl -I http://mira-aviation.com/en
HTTP/1.1 301 Moved Permanently
Date: Mon, 03 Dec 2018 23:57:27 GMT
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Tue, 04 Dec 2018 00:57:27 GMT
Location: https://mira-aviation.com/en
Server: cloudflare
CF-RAY: 4839f9c600163d95-MXP

#20

I switched back to https because it is a website which is at the production stage. and without https it broke the style. I can not keep my test too long, sorry about that.