When a site in a subfolder is moved to a subdomain, .htaccess
rules need to updated to redirect URLs. This can be done by adding the following lines to the .htaccess
file in the root folder:
|
|
This will redirect all calls to domain.com/subfolder/*
to subdomain.domain.com/*
where *
indicates all the subpages under the subfolder.
Couple of points to note for this to work:
- The
.htaccess
rewrite rules work by the line order in the file. So these rules need to be above other rules for it to work. - On WordPress sites, place these lines above the WordPress redirect rules, i.e., above the
# BEGIN WordPress
line. - The
.htaccess
files in the subfolder need to be removed.