redirect-module icon indicating copy to clipboard operation
redirect-module copied to clipboard

Module fails to return a redirect, for URI's that contain query strings

Open toddpadwick opened this issue 2 years ago • 2 comments

Query string rules do not work - such as: /news/?filter_category=universities => /loop

It simply returns a 404.

toddpadwick avatar Jan 31 '22 16:01 toddpadwick

Hi @toddpadwick, I've found an easy solution for this problem. The field from is expecting a regex, so the problem is that ? will be interpret as a quantifier. To fix the problem, you have to escape special characters with \

You should have something like that: { from: '/news\?filter_category=universities', to: '/loop' }

Thomas-Deasington avatar May 09 '22 09:05 Thomas-Deasington

Ah okay thank you @Thomas-Deasington . That works now!

toddpadwick avatar May 11 '22 07:05 toddpadwick