Help - Search - Members - Calendar
Full Version: sub domain question
Hostony Board > General Support > General Support
vuzzan
Dear all,

in Cpanel, it will make the sub domain and point to the same dir-name in public_html dir.
i need to point the subdomain to the directory which i choosed.
Exapmle:

Cpanel:
http://sub-domain.domain.com re-dir to puclic_html/sub-domain

I need:
http://sub-domain.domain.com re-dir to puclic_html/my_dir/sub-domain

Could i do it by using mod_rewrite in file puclic_html/.htaccess ?

CODE
RewriteEngine On
RewriteCond %{HTTP_HOST} [^.]+\.domain\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) http://domain.com/my_dir/$1 [R]


If posible, can you help me ?

thank you,
Stanly
I can grant you Override All option in httpd.conf file to grant you privileges to do this.
Also if it will not work (bad syntax, etc), you can use a simple HTML/JavaScript redirection for this. I can show you example code.
vuzzan
thank you,
i need your grand to do this.
i think i use the .htaccess. You know, i have many user on my site, so each user have 1 subdomain. I could not put them to public_html directory.

here is my domainname: vnem.com

thank you for your help,
Stanly
Ok, I've done this for your domain name.
vuzzan
thank you very much biggrin.gif
vuzzan
Dear Sanly,

I tried with the .htaccess file in the /public_html/ directory. But the sub domain does not run too.
I think that rewrite_rule is OK, but it seem there is the error in the DNS.
DNS could not found the sub domain in wildcard.
Ex: http:\\xyz.vnem.com -> the DNS could not found.
When i try to ping xyz.vnem.com ( "xyz" except "mail", "www", "sales" .. ),
The error "Unknown host xyz.vnem.com" occured.

could you please help me ?

thank you for your help,
Stanly
You need to have this subdomains at your DNS zone at first smile.gif
vuzzan
ohmy.gif

QUOTE
You need to have this subdomains at your DNS zone at first 


i don't understand what is "your DNS zone".
You mean,
1. I come to my Cpanel, and add on the sub domain first, right ?
2. Or is there the DNS configure in my Cpanel ?

Could you please explain more detail?
Thank you Stanly,
Stanly
Please try to access one of your subdomains now.
Are you able?
vuzzan
thank you Stanly,

When i request http://xxxx.vnem.com it gone to Cpanel message "There is no website configured at this address."
Stanly
Yes, until this subdomain name will not be created at your control panel smile.gif
vuzzan
thank you Stanly,
It very good now.
biggrin.gif biggrin.gif

Iam sorry, but i have one more question:
When i want to add one one sub-domain, i must come to Cpanel and add first.
Is there any other way ?
I mean could we don't need to use Cpanel to add on sub-domain ?

Regards,
Alec
You can add subdomains in control panel only
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.
IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here