I have some files placed under a particular folder in my old domain like this: http://www.olddomain.com/folder1/.
I want to redirect all requests that try to access files under this folder to a new domain. Example: http://www.olddomain.com/folder1/page1.html -> http://www.newdomain.com/page1.html
How do I accomplish this using .htaccess?
Give this a shot.
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^folder1(.*)$ http://www.newdomain.com/$1 [L,R=301] </IfModule>
1.4m articles
1.4m replys
5 comments
57.0k users