RewriteCond %{REQUEST_URI} ^(.*)/dir1/(.*)$ # if the line contains /dir1/ RewriteRule ^(.*)$ %1/dir2/%2 [R=301,L] #Redirect all URLs starting with from dir1 to dir2, preserving the future of the URL structure
Find more questions by tags htaccess