I am trying to create a regex for 301s that will help me identify the url: site.com/abc/ and redirect to site.com/xyz/. I’ve tried regex as ^abc/? and it works fine but the problem is even urls like site.com/123/sdas/abc/213 are getting caught. How can I ensure only /abc gets matched with the full string url?
I am trying to create a regex for 301s that will help me identify
Share
Use the end of line anchor
$:This ensures that the exact string
abc/will be matched.