How can I create a subdomain using only .htaccess? or whatever.

Status
Not open for further replies.

Jondoe0069

New member
Mar 21, 2007
1,317
19
0
Estados Unidos
I work for a big company that, for some reason, uses 20 dollar a month shared at&t hosting (Unix) that sits on a 15 year old server with a control panel from 1970. The problem is- I can't create a subdomain to point to a specific directory and maintain the subdomain.domain.com formatting in the address bar throughout that directory.

I added an a-name for the subdomain. Then i created an .htaccess file and redirected the subdomain to the new directory, but once the redirect was complete, it showed domain.com/subfolder rather than subdomain.domain.com

I've talked to 8 people from AT&T and a couple said that it's not possible to create a legitimate subdomain with any of their hosting packages, while the others didn't know anything about anything.

Is there a right way to do this? Or is this somehing my host would have to support? I don't even have access to anything above the root folder for the public files for the main domain.


IF THIS IS NOT POSSIBLE:

Is it possible for me to sign up with a new host that offers subdomains, point company.com to them, set up a subdomain for division.company.com... and still somehow point the otherdivision.company.com to that division's web server...... and still have otherdivision.company.com show otherdivision.company.com in the address bar when on that site?

Any help would be great!
 


I use the following code to do wildcard subdomains. I use the code in the httpd.conf file, but I think it will do the same in a .htacces-file.

you might need to tweak it a little before it does what you want, though.

Code:
                RewriteEngine On
                RewriteCond %{HTTP_HOST} ^(.*)\.domain\.tld   
                RewriteRule ^(.*)$ /%1/$1 [L]
 
Status
Not open for further replies.