How can I use the Apache OR operator to redirect several paths to one URL? E.g.:

RewriteEngine on
RedirectMatch   301 /foo || /foo/bar || /das.html https://example.com/ext/ddy/$1

Thanks for any help.


Solution 1:

RedirectMatch 301 ^(/foo|/foo/bar|/das.html)$ https://example.com/ext/ddy/$1

You can learn about this in the docs for Perl-Compatible Regular Expressions (PCRE), which Apache uses.