If I use this:
<IfModule mod_rewrite.c>
RewriteEngine On
RedirectMatch 301 ^/training/(.*) /faculty/training.html
</IfModule>
the redirects don’t occur.
Same with:
<IfModule mod_rewrite>
...
</IfModule>
However, this works as expected:
RewriteEngine On
RedirectMatch 301 ^/training/(.*) /faculty/training.html
In other words, the redirect works fine outside of the <IfModule> block.
Is there a reason why <IfModule> wouldn’t detect mod_rewrite.c?
The
RedirectMatchdirective is part ofmod_alias.cand notmod_rewrite.c, You want your IfModule to check for mod_alias.c. You also don’t need to turn on RewriteEngine since RedirectMatch doesn’t use it.