Forum Moderators: phranque
redirect 301 /subdir/ http://www.example.org/ redirect 301 /subdir/ http://www.example.org/
only works for the index file, all the other files return a 404 error on the .org site
RedirectMatch 301 /subdir/ http://www.example.org/ RewriteRule ^/subdir/$ http://www.example.org/ [L,R=301]
^subdir/
RewriteRule ^subdir/ http://www.example.org/ [L,R=301]
If you use RewriteRule for any of your rules, you should use it for all of your rules. That is, do not have Redirect or RedirectMatch directives anywhere else within the same site.
I need the pages to redirect to the corresponding pages on the new domain.
Why is this?
Redirect and RedirectMatch are processed by mod_alias. RewriteRule is processed by mod_rewrite. The .htaccess file is processed in "per module" order.