For Techs.... Techniques.... Technologies....


How to redirect folder to its sub-folder using htaccess

Some times its necessary to redirect all the connections to a folder to its sub-folder. We can achieve the same by adding the below rule in .htaccess file.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/Folder/Subfolder
RewriteRule ^Folder/$ /Folder/Subfolder/ [QSA,L,R=301]

Just replace the 'Folder' and 'Subfolder' with the corresponding names.

That's all....

Leave a Reply