I try to use Apache mod_rewrite to redirect some pages on my customer's website to the homepage. The .htaccess file is the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^environment/teach-your-kids-to-go-green/(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/event\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/films\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/lastcomm\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/join\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^capturenature(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/blog\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^capturenatur(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/roadtomecca\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^capturenature/(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^shopping/engagement-rings-for-men/(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/thecallhome\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteRule ^a3ff/stateofthings\.html(.*) [DOMAINNAME]/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
For some reason, this rewrite rule - RewriteRule ^a3ff/(.*) [DOMAINNAME]/$1 [R=301,L]
- doesn't work on the production server. It does work on my development server, however. When I use RewriteRule ^a3fff/(.*) DOMAINNAME/$1 [R=301,L]
, for example (one character appended), it works perfectly. It's probably the strangest .htaccess problem I've ever seen. Can anyone help me?