Htaccess: Redirect Sub-Directory of One Domain to Another Domain

If you want to redirect the sub-directory /test/1234 under your current domain and all the files under it to in a way that you don’t lose any of the google link juice, then you can add the following code snippet to your .htaccess.

<IfModule mod_rewrite.c%gt;
RewriteEngine On
RewriteCond %{REQUEST_URI} /test/1234 [NC]
RewriteRule ^(.*)$$1 [R=permanent,L]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.