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

Sub-domain question

#1
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
 

Jake Bunce

XenForo moderator
Staff member
#2
They told me that they only can direct the sub-domain to the root of my site (public_html).
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
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.
Yes, they can.

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

Jake Bunce

XenForo moderator
Staff member
#4
Is there any problem if I do this? Lets say, if in the future I want to install a portal ...
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?
 

caliman

Active member
#5
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:

Code:
<VirtualHost *:80>
ServerAdmin matt@test.com
ServerName beta.test.com
DocumentRoot /var/www/html/beta
</VirtualHost>
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.

caliman