Jonathan Andersson
Jonathan Andersson

Reputation: 1057

Cloudflare with "always use https" on breaks url and removes querystrings

I'm working on a pretty large booking site, I recently discovered that we got many requests that just didn't go through because of missing parameters error.

I checked out logs and noticed that all browsers running safari (both mobile and desktop, and some older versions of IE) had this problem.

The problem is that when we go from our search step to our booking we switch over to https, this is done via the "always https" option in cloudflare, with a pattern that looks like: http://www.exampel.com/Booking/*

The url for the page I want to access is: http://www.exampel.com/Booking/Book#!/?Product=1&product=2

Clicking the link will lead me to that page in chrome and firefox, but NOT in safari (and some older versions of IE) that will send me to:

http://www.exampel.com/Booking/Book

Upvotes: 1

Views: 848

Answers (1)

Scotty Waggoner
Scotty Waggoner

Reputation: 3380

I ran into this problem of Cloudflare dropping query strings and got around it by not using the Always uses https option. Instead I created these 3 redirect rules:

http://example.com/*      Forwarding to https://www.example.com/$1
http://www.example.com/*  Forwarding to https://www.example.com/$1
https://example.com/*     Forwarding to https://www.example.com/$1

You can adjust them if you want the non www url to be available and not redirect away from it. In my case I directed everything to the https://www.example.com version.

I'm not sure why you were seeing it only on certain browsers though.

Upvotes: 2

Related Questions