Home » Web Design and Development » Website Hosting » How to redirect subfolder of a domain to subdomain ?

How to redirect subfolder of a domain to subdomain ?

Recently when we migrate one of our website from one hosting provider to another hosting provider, we decided that we should move only few subdomains of the main website to second hosting provider and continue for few subdomains with existing hosting provider.

One major thing during this migration, we wanted to do is convert the subfolders of domain ( e.g. https://www.greenecosystem.in/blog/ ) to subdomains ( e.g. https://blog.greenecosystem.in ) . During this migration we wanted to make sure , the current google search indexed URL’s should redirect to our new subdomains.

So, this redirection of subfolder to subdomain can be done by modifying .htaccess file from subfolder as,

RewriteEngine On
RewriteCond %{HTTPS} off
Redirect /blog https://blog.greenecosystem.in

so, with this change all your google search indexed URL’s will get redirect to new subdomain.

As per your domains requirement, you will need to change below line from above code,

Redirect /blog https://blog.greenecosystem.in

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment