Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    January 18th, 2005
    Posts
    82
    how to block sub domains
    I have domain domain.com , i am hosting another domain "abc" on the same hosting account, this creates a new sub domain abc.domain.com

    How to block users from accesing www.abc.domain.com? I want the users to go to www.abc.com and not to www.abc.domain.com

    This is similar to what webhosting companies do for shared hosting, but I don't know how to disable subdomain access, any help?

  2. #2
    ABW Ambassador DesignerWiz's Avatar
    Join Date
    January 18th, 2005
    Location
    U.S.A
    Posts
    2,777
    Hello Likemynick,

    Have to you tried any .htaccess rules or tricks?

    I'm not sure if this URL Below will help you, but it's worth a view.
    http://www.tedpavlic.com/post_apache...g_examples.php
    Ray Thomas
    Webmaster Resources: http://DesignerWiz.com
    ABW Board Category: Programming / Coding
    http://forum.abestweb.com/forumdisplay.php?f=190

  3. #3
    Newbie
    Join Date
    January 18th, 2005
    Location
    Tennessee, US
    Posts
    36
    I have that problem, too - and especially with the search engines indexing the subdomain in addition to the domain that is pointed to it (ack!). I host with ThirdSphere though and just found a solution in their FAQ's. It's a simple 3 lines you add to the .htaccess file.

    Have you checked with your host? If they dont have it posted on the site, you might put in a ticket and see if they can give you the code to use...
    <b>Lynn Terry</b>
    (<a href="http://clicknewz.blogspot.com">my blog</a>)

  4. #4
    Member
    Join Date
    January 18th, 2005
    Posts
    82
    Thank you DesignerWiz and Lynn,


    Quote Originally Posted by Lynn Terry
    I host with ThirdSphere though and just found a solution in their FAQ's. It's a simple 3 lines you add to the .htaccess file.
    Could you post those 3 lines of that I need to add to .htaccess file?

  5. #5
    Newbie
    Join Date
    January 18th, 2005
    Location
    Tennessee, US
    Posts
    36
    Sure! This is the 3 lines of code:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.domainname.com
    RewriteRule ^(.*)$ http://www.domainname.com/$1 [R=permanent,L]

    You put it in the .htaccess file in the root directory for your subdomain (not the primary domain). If you have several domain names pointing to subdomains, you can just add that to the .htaccess file for each one.

    (Replacing domainname.com with your own domain name, of course)
    <b>Lynn Terry</b>
    (<a href="http://clicknewz.blogspot.com">my blog</a>)

  6. #6
    Member
    Join Date
    January 18th, 2005
    Posts
    82
    Thank you

  7. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. New on the block
    By vivigirl in forum Introduce Yourself
    Replies: 7
    Last Post: October 16th, 2007, 08:27 PM
  2. Domains for Sale - Mostly Poster Domains
    By SamyT in forum Midnight Cafe'
    Replies: 1
    Last Post: July 23rd, 2006, 01:38 PM
  3. Affiliate Shopping Mall domains or small niche domains?
    By affiliatetracking in forum Voting Booth
    Replies: 13
    Last Post: February 20th, 2004, 02:28 PM
  4. Sub Domains (free Internet Domains)
    By garystarling in forum Domains & Hosting
    Replies: 0
    Last Post: February 27th, 2002, 05:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •