Jump to content

Run site from root or sub-directory?

Tony Carnell

Recommended Posts

Hi all,


I'm just looking for some advice really.

We've got a current website in the root of our hosting account and have been developing a new Processwire powered one in a sub-directory.

We're now getting close to setting the new site live and I'm wondering which is best; leave the new site in the sub-directory and modify the .htaccess file to point to it, or remove the existing site and move the new one across to the root.

We're also looking to install Piwik in its own folder too, together with the Piwik Analytics module. Would this work if the site remains in the sub-directory, because Piwik would effectively be in a sub-directory off a sub-directory?

Basically it comes down to which is the more satisfactory option, leave it where it is versus move it to the root.

If it stays in the sub-directory, I'll want to change the .htaccess file to point at that location, but also hide the sub-directory so it looks as if it's running from the root, e.g. the site is running from www.example.com/cms/ but the visitor never sees the /cms/ in the urls.

Thanks in advance for any advice.


Link to comment
Share on other sites

6 hours ago, Tony Carnell said:

What advantage does that provide?

For me, it follows a principal called 'separation of concerns'. Running analytics has nothing to do with the actual running of your site, and so it should be kept separate, on another domain (or subdomain, which is technically another domain).

So my recommendation is the same - move PW site to the public root and move analytics to a subdomain public root.

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...