Redirection (in netlify.toml) stopped working (with optional query)

My Netlfiy site (1noteme.netlify.app), a URL shortener, was build around Netlify redirects. This site gets little use, but I noticed it is no longer working.

You can view the source on GitHub, and you can use the website here: https://1note.me (there is validation to ensure onenote:<anything> format).

I used a simple redirect rule, that redirected /?l=<unique_id> to a function that returned a redirection. This worked well for me. However, this is no longer working (and nothing has changed on my part).

Reading through the community, I did see some solutions, but none of them used the query parameter of the redirect. The way it worked before, was that this had to match in order to redirect. When the user went to https://1note.me, the redirect didn’t trigger as the l param was missing. When they navigated to https://1note.me/l=1234, it would redirect to my function.

I have tried (from other posts), removing status = 200 and also tried adding force = true. No joy.

I am using redirects via netlify.toml and cannot say exactly when this stopped working. Any help appreciated.

Thanks,
Damien

Hey Damien,

Is it bad that this is working for me? :sweat_smile:

OneNote●Me

Hey @Scott,

Thanks for your response. The generating is working, yes. But the actual redirecting (the fetching part) is not. By right, clicking this URL:

https://1note.me?l=pjsJjDWeA

would redirect it to the function, which would then open OneNote on your computer. The redirection redirects it to here:

https://1note.me/.netlify/functions/open?l=pjsJjDWeA

Notice how it works? Obviously the redirection makes it much, much cleaner. But, it ain’t working.

Here is my netlify.toml for inspiration.

Thanks

I think you’re going to need to force the rule because, otherwise, your homepage is being served.

Can you hit the rule with a force = true?

Sorry for not picking up on what you’re trying to achieve sooner – pesky Mac user!

@Scott this worked! Damn, when I said I had tried force = true, I didn’t realise I had pasted in force = false instead (in the commit). Thanks very much. Damien

It happens! Glad you’re sorted :stuck_out_tongue: