Creating subdomain using mod rewrite, possible?

Discussion in 'Site & Server Administration' started by MikeLiao, Sep 29, 2008.

  1. #1
    Is it possible that when a visitor typed in
    http://www.my-sub-folder.example.com on their browser's address bar, it will get / retrieve the contents of the page from
    http://www.example.com/my-sub-folder (but the address bar will remain as is (http://www.my-sub-folder.example.com)?

    How about this one?

    http://www.member-name.example.com retrieved from http://www.example.com?var=member-name
     
    MikeLiao, Sep 29, 2008 IP
  2. nimhost

    nimhost Active Member

    Messages:
    235
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #2
    yes you can if your script support it like wpmu does and your domain supporting wildcard dns :)
     
    nimhost, Sep 29, 2008 IP
  3. MikeLiao

    MikeLiao Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you explain more and how. Is it not possible using a modrewite on my htaccess file no matter whether my host support wildcard dns or whatever. Thanks
     
    MikeLiao, Sep 29, 2008 IP
  4. xous

    xous Active Member

    Messages:
    173
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Hi,

    What type of a server is it?

    Not only must your DNS server support wildcard DNS you must also have the servers httpd server configured to for every sub-domain. i.e. ServerAlias *.example.net. This cannot be done in cPanel.

    The other solution would be to get a dedicated IP address.
     
    xous, Sep 30, 2008 IP