a question on subdomain

Discussion in 'Site & Server Administration' started by wordlinkz, Nov 16, 2007.

  1. #1
    hello.

    is it possible to make a subdomain like
    say

    api.code.google.com as an eg.

    and not code.google.com/api

    if possile pls tell how to do in apache
     
    wordlinkz, Nov 16, 2007 IP
  2. ray9

    ray9 Guest

    Messages:
    69
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There are two ways of doing that:

    I. Create a seperate account
    You do it the same way you do it for code.example.com:
    1. First create an account/site where api.code.example.com is located and configure apache the same way as for code.example.com (make sure you use the reight names and paths though).
    2. Then add an A entry for api.code.example.com to the zone file for code.example.com

    It should look like this
    api    14400    IN  A  xxx.xxx.xxx.xxx
    Code (markup):
    replace xxx.xxx.xxx.xxx with the IP where api.code.example.com is located

    II. use mod_rewrite
    check out http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html for help
     
    ray9, Nov 16, 2007 IP