Redirect Subdomain to Subdomain/subdirectory

Hi, we have a site running on a subdomain currently (

We would like to ‘redirect’ this site to a subdirectory of this subdomain ( so we can redevelop the root level site while keeping the existing site functioning in this subdirectory (where it may exist permanently eventually).

The site is already using an .htaccess file to rewrite URLs into friendlier SEF URLs (it’s a Joomla site). So the main root file (index.php) is already re-written as ‘’. And any sub-pages are re-written as ‘’ instead of ‘’.

So would there be a way to redirect all of the existing pages for the public, but still give us a way to manually view pages in the root as we test the new redeveloped site?

Thanks! I’m a bit new to htaccess redirects.


IMHO, the best way to do this is to set the DocumentRoot of the subdomain to the subdirectory. cPanel does this by default so, if you’ve already established the subdomain as being co-located with the main domain, you may need your sysadmin to change the VirtualHost file for you. Anything else is a waste of resources.