Subdomain redirect to script as argument

Discussion in 'Server Operation' started by cooljai, Jun 12, 2007.

  1. cooljai

    cooljai New Member

    Hi,

    I want to fetch the "subdomain" entered by user in a script and then execute that script (script "show.php" is resides in web root and should run everytime when site accessed with a subdomain), instead of creating folder for each subdomain. I'm on CentOS 4.4/Apache 2.0

    something like this, when a user type:
    http://user1.mydomain.com
    A script i.e. show.php should get user1 (subdomain part) as argument and then execute, like:
    http://user1.mydomain.com/show.php?user=user1

    I know that mod_rewrite/ .htaccess will do things here but no luck yet despite much googling/forum searching.

    Thanks & Regards,

    Jai
    -------------------------
    ek chota mota hindustani
    -------------------------
     

Share This Page