I've been directed here by support at WPengine, but I'm not sure whether this question should be asked here or over on Overflow...
I'm using RegEx to redirect all paths and pages of a sub-domain to one page on our new website using a "domain specific" (in this case http://sub1.ourdomain) Redirect 301 ^/.* https://ourdomain/location/city
, but there is one single page (eg. http://sub1.ourdomain/email_disclaimer) that I need forwarded to https://ourdomain/legal-notices. It will be the same for about 11 other sub-domains (sub1,.ourdomain sub2.ourdomain etc).
How do I do this? Can I create some sort of exception to the wildcard redirect?
WPengine suggested a "negative lookahead", which uses !
or something right? But, that'll only exclude it from the wildcard and not forward it elsewhere won't it?
I'm really new to RegEx and am not sure how this works and what syntax to use.
I've already looked at Regex negative look-ahead is not working for mod_rewrite between different Apache versions, but am not sure what I'm looking for to help my situation.
To help clarify, the main domain has more than 700 other "ALL DOMAINS" redirects currently in place that are either 1-to-1 (Redirect 301 ^/path/to/page_01/?$ https://ourdomain/newpath/to/new-page-01
) or wildcard-to-1 (Redirect 301 ^/path/to/category_01_.* https://ourdomain/newpath/to/category-01-overview
)and they are working OK at the moment (when I modify my computer's HOSTS file to emulate a DNS change that hasn't been done on the live website yet). So it is the sub-domain specific wildcard-to-1 redirects I need to create a single page exception for.
Thanks in advance