Changing document root for website

3 posts / 0 new
Last post
#1 Fri, 04/20/2012 - 08:42
bison

Changing document root for website

I`m making a new website while the old is still online

I`m maiking the new one, in a directory in root called version2.

When I`m all done I want to change from the old version to the new version in folder"version2"

How and where do I change so the new website root will be "version2"

from this

/home/site/public_html

to this

/home/site/public_html/version2

regards bison

Fri, 04/20/2012 - 10:02
ronald
ronald's picture

when done, why not move the old site to /oldsite and the site in /version2 to root?
That's much easier than changing your doc root in apache

Sat, 04/21/2012 - 16:17
Locutus

ronald has a point. :)

If you have to change the root of the active page for some reason: The Document Root entry would have to be changed (not directly accessible through Virtualmin for existing servers - you need to use Services / Configure Website / Document Options), and possibly a redirect for "/" to "/version2" is required so that the correct version is loaded when a user fetches your URL with just the hostname.

Even better, but also more complicated, than a redirect would be using Apache's mod_rewrite; then the user would not see the "/version2/" in the URL path.

All in all, moving directories indeed would be easier.

Topic locked