.HTACCESS And Subdomains

Discussion in 'HTML & Website Design' started by bigpapa, Feb 23, 2008.

  1. #1
    I have some subdomains setup on my site. The redirection works as follows:

    domain.com/sites/blue > blue.domain.com
    domain.com/sites/green > green.domain.com
    etc.

    The subdomains are working fine, but I was wondering if there is something I can put into my htaccess file to prevent people from accessing the site by typing in domain.com/sites/blue. I want a (301?) redirect to blue.domain.com.

    How would I do this? Thanks for your help.
     
    bigpapa, Feb 23, 2008 IP
  2. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #2
    I can't imagine why though. What's the big deal if they type in the full address - the page will still come up!

    I think people don't realize what the web is. It's just files sitting on a hard drive on some unix computer somewhere that you connect to like your own harddrive. Sure you can make it redirect, but you can't lock everything down or else people wouldn't be able to access it.

    If you're not ready for people to see what you've got there, maybe you aren't ready to put this content online.
     
    innovati, Feb 23, 2008 IP
  3. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As a matter of fact, Im running a script that is setup to run off the subdomain. All of the paths are setup to the subdomain. The script will not work when the site is accessed from its path from the main domain.

    So, instead of trying to tell everyone how the Internet works, why not move on if you don't have an answer and spam someone else's thread?
     
    bigpapa, Feb 23, 2008 IP
  4. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The solution to your problem depends on the specific needs of the script. Could you give more details about its workings?

    BTW, you say that "I want a (301?) redirect to blue.domain.com.". What is impeding you of doing it?
     
    TechnoGeek, Feb 23, 2008 IP