Subdomain creation using .htaccess & mod_rewrite

Discussion in 'Apache' started by bersude2, Dec 22, 2010.

  1. #1
    This is a very simple project for someone who knows .htaccess, mod_rewrite, and apache extensively.

    I have a PHP file when queried is of the sort:

    http://www.usawebonline.com/search.php?site=cnn.com

    I need it re-written to be

    http://cnn.com/usawebonline.com

    IF NOT possible to use their domain as the subdomain, acceptable alternatives are:

    http://cnn-com/usawebonline.com (subbing "." for "-")
    http://cnncom/usawebonline.com (removing ".")


    I've tried many possibilities to achieve this but these is a detail wrong in every attempt, otherwise I would post what I have tried.

    Please help!
     
    bersude2, Dec 22, 2010 IP