Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[HTACCESS] Subdomains + Specific Directory

Status
Not open for further replies.
Custom Title Activated
Loyal Member
Joined
Dec 10, 2007
Messages
2,194
Reaction score
263
I have recently figured out how to setup a wild card subdomain that allows me to use any subdomain that I want on my main domain.
Code:
*.domain.com

However, I'm having an issue with specifying which directory I want all wild card subdomains to use. At the moment they're using the main directory for the domain (domain.com/). The problem is that I would like all wild card subdomains to use /specificdir/ (domain.com/sepcificdir/) by default.

I hope that made some sense. :scared:
 
Newbie Spellweaver
Joined
Nov 2, 2009
Messages
54
Reaction score
21
Google "apache virtualhost" and you'll get your answer.
 
Custom Title Activated
Loyal Member
Joined
Dec 10, 2007
Messages
2,194
Reaction score
263
It doesn't matter if it's mod_rewrite or .HTACCESS based. The only thing that matters if the solution works. I've honestly been searching for hours - but not knowing what to look for in the code makes it very hard for me.
 
Newbie Spellweaver
Joined
Nov 2, 2009
Messages
54
Reaction score
21
Open your your httpd.conf
Add those lines at the end of it (ofc replace with the correct values)

Code:
<VirtualHost *:80>
DocumentRoot C:\PathTo\subdomainone
ServerName subdomain1.mywebsite.com

</VirtualHost>

<VirtualHost *:80>
DocumentRoot C:\PathTo\subdomaintwo
ServerName subdomain2.mywebsite.com

</VirtualHost>

Restart your webserver
 
Custom Title Activated
Loyal Member
Joined
Dec 10, 2007
Messages
2,194
Reaction score
263
Open your your httpd.conf
Add those lines at the end of it (ofc replace with the correct values)

Code:
<VirtualHost *:80>
DocumentRoot C:\PathTo\subdomainone
ServerName subdomain1.mywebsite.com

</VirtualHost>

<VirtualHost *:80>
DocumentRoot C:\PathTo\subdomaintwo
ServerName subdomain2.mywebsite.com

</VirtualHost>

Restart your webserver
Is it possible to make the subdomain "global"? Instead of having to add the subdomains individually as I'm using wildcard subdomaions and every subdomain has to use the same directory to run the script I'm using.

EDIT:
Problem solved. Thanks for all the help guys.
 
Last edited:
Status
Not open for further replies.
Back
Top