I use a RedirectMatch
rule which should exclude the following two URLs:
citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen
citycards/citycards-locations/munchen/citycards-4-you-munchen-hirtenstrasse-18-munchen
I use this rule with regex, but I get a 500 Internal Server Error:
RedirectMatch 301 /citycards/citycards-locations/muenchen/((?!citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen|citycards/citycards-locations/munchen/citycards-4-you-munchen-hirtenstrasse-18-munchen ).+)$ /citycards/citycards-locations/muenchen/$1
Any ideas why it doesn't work?
Your rule currently is: (broken down to multiple lines for better display/understanding):
RedirectMatch
301
/citycards/citycards-locations/muenchen/((?!citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen|citycards/citycards-locations/munchen/citycards-4-you-munchen-hirtenstrasse-18-munchen ).+)$
/citycards/citycards-locations/muenchen/$1
Basically, your regex says that:
/citycards/citycards-locations/muenchen/
which is not followed by either of the following
citycards/citycards-locations/munchen/citycards-trachtenvogl-reichenbachstr-47-munchen
,citycards/citycards-locations/munchen/citycards-4-you-munchen-hirtenstrasse-18-munchen
(it has a space after 18-munchen
)and redirect the matched URI to: /citycards/citycards-locations/muenchen/$1
which is basically the same URL that was matched against.
I see 2 issues.
RedirectMatch
directive, leading to status 500 error