+ Start a Discussion
BPeddleBPeddle 

URL Redirect

Is there any wildcard or way to setup so it doesn't do an exact match.

 

I want to do a redirect anytime it hits a relative url like /detail/foo ... however if it has a querystring it ignores it  so this does nothing 

/detail/foo?id=xxxxxxxxxxxxxxxx

 

Tried a variety of different formats but no luck.  Not sure it is possible.

 

Thanks

Ryan-GuestRyan-Guest

There is no wildcard support for URL redirects.

(e)(e)

You could likely use a regex expression using the pattern and matcher classes to sort out urls. Or even a simple url.contains('?id=') might be a quick solution for you.

Ryan-GuestRyan-Guest

You can use a regex for URL rewriting, but not with redirects. 

ericszulcericszulc

Ooops... redirect not rewrite. Sorry for the misinformation.

tonybrasunastonybrasunas
If you're trying to set up a "URL Redirect" that ignores the query string, inside site.com you want to use a "matchless alias." To do this you go into Site Configuration > URL Redirects and create a new redirect. Select "Alias" for Redirect Type and then make sure the "Match" checkbox is NOT checked. You'll then have a matchless alias that will ignore the query string.