Forum Moderators: phranque
I would still appreciate someone's opinion to see if I am on the right track and I apologize if this has been discussed before (I truly couldn't find a specific thread on the first 4 result pages, searching WW).
On trying to transfer an entire subdirectory from an old domain to a new domain I placed an .htaccess file at the root of the original domain like this:
redirect permanent /subdirectory/file1.html [newdomain.com...]
The subdirectory at the old domain has 200 pages, all named differently which should be at the root of the new domain. Does this mean I will have to write 200 command lines, one for each redirected file?
Thank you for any help.
RewriteEngine on
RewriteBase /subdirectory/
RewriteRule ^subdirectory(.+) [newdomain.com$1...] [L,R=301]
This basically tells your web server to catch all requests for files in "subdirectory", make a note of the file name, and issue a 301 header to the browser with a redirect to "newdomain.com/file name".
Hope this helps,
Ewan