subdomains question

Discussion in 'Apache' started by pedroz, Aug 17, 2007.

  1. #1
    part 1: working :)
    -----------------
    ErrorDocument 404 http://www.domain.com/error.htm

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.domain\.com?$
    RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com$
    RewriteRule ^$ /index.php?subdomain=%1 [L]

    http://www.domain.com -- no redirection
    http://us.domain.com rewrite to http://www.domain.com/index.php?subdomain=us
    http://es.domain.com rewrite to http://www.domain.com/index.php?subdomain=es
    ... and so on


    part 2: what I need :confused:
    -----------------------
    http://www.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?action=$1
    http://us.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?subdomain=us&action=$1
    http://es.domain.com/(*.).htm rewrite to http://www.domain.com/index.php?subdomain=es&action=$1

    some sort of
    http://www.domain.com/register.htm rewrite to http://www.domain.com/index.php?action=register
    http://us.domain.com/register.htm rewrite to http://www.domain.com/index.php?subdomain=us&action=register
     
    pedroz, Aug 17, 2007 IP