Log in Sign up

Redirects with query strings not working?

I noticed that redirects lead to 404 page when the link is accessed from a Facebook post. Apparently, Facebook appends a tracking parameter ?fbclid=* to the url and it messes up the redirect. Is there a way around this?

3 replies Asked May 22 '22 at 16:01 · Improve this question

Interesting – I haven't run across this before. Appending an additional query to a URL shouldn't in theory break anything on Blot. Would you mind contacting us with a few example URLs that are breaking and we'll take a look.

Answered May 24 '22 at 7:45 · Improve this answer

I looked into it further. It seems to only affect WebKit-based browsers. I can’t replicate the behaviour on Chrome and Firefox on macOS. Sent you an email. (Hope it doesn’t get flagged for spam because of the very long Facebook link)

Answered Jun 1 '22 at 7:27 · Improve this answer

The issue turned out to be: Blot's redirects treat query strings as part of the URL path, e.g. consider this redirect:

from: /foo
to:    /bar

The above redirect will not match the following requests:

/foo?fbclid=x
/foo?bar=baz

The solution was to create the following redirect:

from: /foo?(.*)
to:    /bar

I will consider ignoring querystrings but need to make sure this won't cause other issues.

Answered Jun 1 '22 at 9:29 · Improve this answer

Markdown allowed