I have set up the 301 redirect below which will redirect /jobs and all subpages below it when a user navigates to
https://www.main-domain.com/jobs/
RedirectMatch 301 /jobs/.* https://www.main-domain.com/all-vacancies/
My issue arises as I have a sub-site in a subdirectory on "main-domain.com" which also uses the path /jobs which is being redirected when I want it excluded e.g.
https://www.main-domain.com/subsite/jobs/
# I don't want this url redirected back to https://www.main-domain.com/all-vacancies/
I have tried the below to keep the /jobs to only redirect from the root of the domain but it did not work and I am stumped!
RedirectMatch 301 ^(?i)/jobs/.*?$ https://www.main-domain.com/all-vacancies/
Cheers, JB.