Regex thorugh URL Mapping


#1

Trying to setup a Regular Expression Redirect and its not working. ((Content > Content Settings > COS URL Mappings.

Based on my research of Regex, /^tds-download$ start at ^ and end at $ . I have this expression (/^tds-download$) setup as the Redirected URL and the Redirect Destination is the homepage (http://www.mcpolymers.com).

Under the Advanced options, these are checked:

  • Redirected URLs should match original URL’s query string, or lack thereof
  • Original URL is a flexible pattern URL
  • Redirect requests with or without a trailing slash
  • Redirect requests regardless of protocol (either http or https)

However, it still isn’t redirecting if I hit the page directly: http://www.mcpolymers.com/tds-download

Anyone have any insight to this issue?


#2

Hi @Parker_Web

We do support a type of pattern matching for URL mappings, but our flexible pattern matching does not support regex syntax. You can find more details about setting up flexible pattern URL mappings here:

If you just need to redirect that one page to the home page of your site, you should be able to do that by using:
/tds-download for the Original URL or path
/ for the Destination URL or path
You would want to use the same options, except you wouldn’t need the flexible pattern URL option checked.


#3

Thanks for the fast reply!

However this may be tricky…

that tds-download url typically looks like this :http://www.mcpolymers.com/tds-download?pdfUrl=http://inbound.mcpolymers.com/hubfs/Technical_Data_Sheets/Rovene4176.pdf&t=1475613892852 (when coming form a product page)… so we want to make sure that only the exact URL (http://www.mcpolymers.com/tds-download) is the one that redirects – and not the ones that have the ?..with all the other stuff with it.

Would your suggestion hold true based on that new information?