If you want to redirect the sub-directory /test/1234 under your current domain and all the files under it to www.example.com/test/1234 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 ^(.*)$ http://www.example.com/$1 [R=permanent,L]

Leave a Reply

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

You May Also Like

Error While Parsing Json using Python – TypeError: list indices must be integers, not str

Jotting this down for fellow googlers. I recently started learning a bit…

Makefile Tricks: Arithmetic – Addition, Subtraction, Multiplication, Division, Modulo, Comparison

While working on a project, I needed to do some calculations inside…