Forum Moderators: buckworks & webwork

Message Too Old, No Replies

creating a subdomain?

how do i do it?

         

nba1341

5:24 am on Jun 15, 2005 (gmt 0)

10+ Year Member



Ok hi i was wondering how you create a subdomain off of your domain without a program like cpanel or anything. Is there a way to do it through a .htaccess file where i create a folder in my ftp and place some kind of .htaccess file?

-thanks for the help in advance

Romeo

9:46 am on Jun 15, 2005 (gmt 0)

10+ Year Member



Hi nba1341, and welcome here in Webmasterworld.

The quick answer is: no, not likely, not "without ... anything".

A more in-depth-answer is: it may depend on the following:

A subdomain has first to be created in the DNS, either explicitly (sub.example.com. IN A .....) or by wildcard (*.example.com). Otherwise a user request for a subdomain would never reach your server. This has to be done by the DNS maintainer on behalf of the domain owner (you, if you run your own nameserver? or your web service provider?).

A subdomain then has to be defined in the web server's config file, most likely as a new vhost or as an alias to an existing vhost, either for an explicit subdomain, or as a wildcard *.example.com.

Depending on these definitions mentioned above, you finally may catch a subdomain with a .htaccess rule, if your vhost will see it when it comes in.

Regards,
R.

nba1341

10:35 am on Jun 16, 2005 (gmt 0)

10+ Year Member



i have heard you can do this through a .htacess if mod_rewrrite is enabled

can someone post an example of that htaccess file

Dijkgraaf

12:53 am on Jun 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Romeo is right, no you can't do it without having an wildcard A record setup first.

nba1341

2:56 pm on Jun 17, 2005 (gmt 0)

10+ Year Member



i do have a wild card set up on my dns

*.mydomain.com

so how do i add a subdomain wtih a htaccess

when i go to a subdomain right now it takes me to my hosts site

nba1341

11:09 pm on Jun 20, 2005 (gmt 0)

10+ Year Member



i have set up a wildcard can someone tell me what to include in the htaccess file

Romeo

8:01 am on Jun 21, 2005 (gmt 0)

10+ Year Member



Hi Nba,

OK with your DNS setup.
Next you need a server-alias * in your domain's vhosts definition in the webserver's httpd-vhosts-config file, so that all subdomains go to your main subdomain-landing-page.
If you got this, then you are ready to set up some .htaccess rules there.

Further details about how this can be done, what will work and what not, can be found in the following postings.

Regards,
R.

[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]