Friendly urls for dynamic subdomains

Discussion in 'Apache' started by dan101, Apr 18, 2011.

  1. #1
    I use wild card for my subdomains and I need to know how can I do to make the friendly urls

    I have this

    RewriteCond %{ENV:REDIRECT_SUBDOMAIN} ="" 
    RewriteCond %{HTTP_HOST} ^([a-z0-9][-a-z0-9]+)\.domain\.com\.?(:80)?$ [NC] 
    RewriteCond %{DOCUMENT_ROOT}/%1 -d 
    RewriteRule ^(.*) index.php?act=$1 [E=SUBDOMAIN:%1,L]
    RewriteRule ^ - [E=SUBDOMAIN:%{ENV:REDIRECT_SUBDOMAIN},L]
    Code (markup):
    In index.php from my subdomain I have echo $_GET['act'];

    The output from index.php is subdomain1/kjglkjhlkjh/ when I access http://subdomain1.domain.com/kjglkjhlkjh/

    As you see I need the output only kjglkjhlkjh

    Thanks in advance!
     
    dan101, Apr 18, 2011 IP
  2. dan101

    dan101 Peon

    Messages:
    52
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    nobody has idea?
     
    dan101, Apr 20, 2011 IP