kaizmoto1489 Posted June 9, 2021 Share Posted June 9, 2021 (edited) I'm hoping someone can help as I'm new to regex. I have a bunch of URLs and it basically follows the format of: /employer/company-name/various-pages What I need to do, is redirect all the various-pages as they no longer exist. So the URL becomes: /employer/company-name/ The regex I have is as follows: \/employer\/(.+?)\/[a-z0-9\-]+\/ \/employer\/(.+?)\/ The issue I have, I need to make company-name a variable but do an exact match Any help is very much appreciated!!! Edited June 9, 2021 by kaizmoto1489 Quote Link to comment https://forums.phpfreaks.com/topic/312882-navigate-all-other-pages/ Share on other sites More sharing options...
requinix Posted June 9, 2021 Share Posted June 9, 2021 So there's a very specific company-name you want to do this redirect for? Why does it have to be a variable? Quote Link to comment https://forums.phpfreaks.com/topic/312882-navigate-all-other-pages/#findComment-1587116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.