1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sub-domain question

Discussion in 'Server Configuration and Hosting' started by Nowasky, Apr 23, 2012.

  1. Nowasky

    Nowasky Member

    Sry my bad english.

    On my server, inside the "public_html" folder, I have a folder "forum" where xenforo is installed.

    I asked my host to create a sub-domain "forum.meusite.com" so I can access my forum through this address.

    They told me that they only can direct the sub-domain to the root of my site (public_html).

    Doing this, is there any way to make it redirect to the "forum" folder through a .htaccess? If so, how?

    So basically what I want is:

    www.mywebsite.com : access "public_html"
    forum.mywebsite.com (instead of www.mywebsite.com/forum) : access "forum" folder
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is their limitation. Normally this is not a problem.

    To keep the sites separate, ask them if they can create an entirely new web root for the subdomain that is separate from your main domain.
  3. Nowasky

    Nowasky Member

    Yes, they can.

    Is there any problem if I do this? Lets say, if in the future I want to install a portal ...
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It shouldn't be a problem. But you would have to setup appropriate paths to connect any forum applications outside of the forum directory.

    I personally do not recommend this approach. It requires a lot of extra consideration with no benefit other than to satisfy some people's sense of URL organization. Keep forum stuff on the same domain or subdomain, and in the same directory. With different domains you get problems of cookie scope. With different directories you get problems of pathing. Both can be addressed, but what is the benefit?
    Nowasky likes this.
  5. caliman

    caliman Active Member

    Not sure if this is what you are looking for but on a linux box you can setup a sub-domain in httpd.conf with virtual hosting. Example:

    <VirtualHost *:80>
    ServerAdmin matt@test.com
    ServerName beta.test.com
    DocumentRoot /var/www/html/beta
    Note the path for DocumentRoot - you want this to point to your directory.

    This has to be placed before virtrual entry for www.test.com.

    Save, restart apache.

    Then in your DNS configuration you need to add a record for beta.test.com and point it to IP address of server. It will take 24 hours or so to update across the web.

    This worked for me.

    Nowasky likes this.
  6. Nowasky

    Nowasky Member

    Thanks @caliman, i don't have access to that file but i'll show this to my host and see if they can do it
  7. caliman

    caliman Active Member

    No problem. Hope it helps. I just did this twice so it is fresh on my mind.

Share This Page