Would like to use a subdomain

Web hosting discussion, programming, and shared and dedicated servers.
25 posts Page 2 of 3
by thulsa_doom » Mon Dec 19, 2011 8:43 pm
Not at all,

With a single Basic Hosting service, you have an IP address set up on our web server that you can point any domain name's A record to and have web traffic for that domain land in your web directory. Once the request arrives, you can have separate web content split off by means of a .htaccess directive. That is to say that both www.example.com and tcats.example.com would have identical A records (they point to the same IP address) but people browsing to www.example.com would see different content than people browsing to tcats.example.com. The number of subdomains is basically unlimited, so if you have no subdomains it's $19.95/month for the Basic Hosting, and if you have 20 subdomains it's still $19.95/month for Basic Hosting.

The alternative is to set up a separate $9.95/month Value Hosting service that has to be hand-configured by one of our systems staffers any time a change needs to be made (such as creating it in the first place or pointing it to another directory). This would incur an additional $9.95/month cost per subdomain configured.
John Fitzgerald
Sonic Technical Support
by Mark » Mon Dec 19, 2011 10:15 pm
Any example of the .htaccess file John? I have already set this in motion but I have to go get some sleep. The morning comes early.
by virtualmike » Tue Dec 20, 2011 1:43 pm
Suppose I would like to use a subdomain to point to a Google Apps instance; e.g., apps.mydomain.org. Could I do that without any additional hosting, just by pointing the A record to what Google specifies?
by augie » Tue Dec 20, 2011 5:26 pm
Mark wrote:I have sent in a request to ops@sonic.net to have the subdomains pointed to a specific directory.
That's not the right address for customer support, please send to support@sonic.net .
by Mark » Tue Dec 20, 2011 6:31 pm
Augie,

Support cannot do what needs to be done. It is an operations/noc job. I spent time on the telephone and support cannot point domains to directories.

Also, the following doesn't seem to work:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^tcats\.stop\-spam\.org$ [NC]
RewriteCond %{REQUEST_URI} ^/tcats(.*)$ [NC]
RewriteRule ^tcats/(.*)$ /nfs/WWW_pages/markf/stop-spam.org/tcats/$1 [L,R=301]

I have tried variations and don't seem to be getting anywhere. I need to point the domain [tcats.stop-spam.org] to [/nfs/WWW_pages/markf/stop-spam.org/tcats/]

This is on a basic account with an IP.

Currently [tcats.stop-spam.org] to [/nfs/WWW_pages/markf/stop-spam.org/]

Suggestions.....
by Mark » Wed Dec 21, 2011 7:53 am
Fixed the subdomain problem;

This is set up so that all the subdomains and the [www] are under a root domain specified in the domain directory tool for the basic hosting.

/nfs/WWW_pages/user/domain-name.org/sub1/

sub1 - tcats
sub2 - tools
sub3 - www

RewriteEngine on
#www.domain.com and domain.com will map to the folder {root}/folder1/
RewriteCond %{HTTP:Host} ^sub1\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/sub1/
RewriteRule ^(.*) /sub1/$1 [NC,L,NS]

RewriteCond %{HTTP:Host} ^sub2\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/sub2/
RewriteRule ^(.*) /sub2/$1 [NC,L,NS]

RewriteCond %{HTTP:Host} ^www\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule ^(.*) /www/$1 [NC,L,NS]

I have to rewrite the paths in the files that I called out for the includes but that will be short work. The [www] can be anywhere and this way the spiders do not travel into any sub-directory that you have your subdomains in.
by augie » Wed Dec 21, 2011 5:02 pm
Mark wrote: Support cannot do what needs to be done. It is an operations/noc job. I spent time on the telephone and support cannot point domains to directories.
Sorry, I wasn't trying to pass the buck here, just let you know that the e-mail address ops@sonic.net is going to either give you a bounce message or go into a black-hole for you -- it is an internal only e-mail address -- support@sonic.net though will definitely get you to a person who can route the message correctly.
by Guest » Wed Dec 21, 2011 5:29 pm
augie wrote: Sorry, I wasn't trying to pass the buck here, just let you know that the e-mail address ops@sonic.net is going to either give you a bounce message or go into a black-hole for you -- it is an internal only e-mail address -- support@sonic.net though will definitely get you to a person who can route the message correctly.
I have already fixed everything. I am running into an issue with the redirecting a subdomain for another domain.... The code I posted should work for everybody. Feel free to snag it and post it when needed.
by markf » Thu Dec 22, 2011 7:07 am
Sub domain how to

This is a Five step set up and these changes take time to propagate through sonic's name server. This will redirect the requests for your sub-domain to a specific directory through the .htaccess file and redirect the requests for your tld to the sub-domain to the www sub-domain. This removes the need to hide the sub-directories from spiders because they are not down stream from the root directory.

step one, create a root directory to house an index.php and .htaccess file.
user - "your log on ID"
domain-name.org = "the directory name you wish to use to house these files"
root = "/nfs/WWW_pages/user/domain-name.org/"

Step two, create a sub-directory for each sub-domain
www = "/nfs/WWW_pages/user/domain-name.org/www/"
subdomain-1 = "/nfs/WWW_pages/user/domain-name.org/subdomain-1/"
subdomain-2 = "/nfs/WWW_pages/user/domain-name.org/subdomain-2/"

Third step, use the Sonic "modify host" tool to redirect the domain to that IP address sonic provided.
root = "/nfs/WWW_pages/user/domain-name.org/"

Step four, write the .htaccess file and index.php below

.htaccess
<Limit GET PUT POST DELETE>
order allow,deny
allow from all
#disallows viewing the index of the directory
IndexIgnore *
RewriteEngine on

#www.domain.com will map to the folder {root}/domain-name.org/www
RewriteCond %{HTTP:Host} ^www\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/www/
RewriteRule ^(.*) /www/$1 [NC,L,NS]

#subdomain-1.domain.com will map to the folder {root}/domain-name.org/subdomain-1
RewriteCond %{HTTP:Host} ^subdomain-1\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/subdomain-1/
RewriteRule ^(.*) /subdomain-1/$1 [NC,L,NS]

#subdomain-2.domain.com will map to the folder {root}/domain-name.org/subdomain-2
RewriteCond %{HTTP:Host} ^subdomain-2\.domain-name\.org$ [NC]
RewriteCond %{REQUEST_URI} !^/subdomain-2/
RewriteRule ^(.*) /subdomain-2/$1 [NC,L,NS]

#domain.com will map to the folder {root}/domain-name.org/www
rewriteRule ^\$ http://www.domain-name.org/ [R=permanent,L]
</Limit>
The index file is redundant because the last line redirects the domain-name.org to the http://www.domain-name.org and the first line disallows showing the index of the directory.

<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.stop-spam.org/");
exit();
?>

Step five, upload your files to the appropriate directory.
by markf » Thu Dec 22, 2011 12:22 pm
[quote="thulsa_doom"][/quote]
Do you read Conan :-)
25 posts Page 2 of 3

Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 20 guests