Need help with htaccess subdomain rewrite

Discussion in 'Programming' started by Domen Lombergar, Feb 6, 2007.

  1. #1
    hey guys. I'm trying to make a rewrite for a subdomain but it doesn't seem to come up right.

    This is what I currently have:

    RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com?$
    RewriteRule ^$ http://www.domain.com/users.php?m=details&name=$1&comments=1 [L]
    
    Code (markup):
    What I want to achieve is to get something.domain.com to stay on the same url (not redirect) but take www.domain.com/users.php?m=details&name=something&comments=1

    Wildcards are turned on of course.

    Any help much appreciated!
     
    Domen Lombergar, Feb 6, 2007 IP
  2. Domen Lombergar

    Domen Lombergar Peon

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Happy to say I got it fixed. I changed $1 into %1 and it works fine :)
     
    Domen Lombergar, Feb 6, 2007 IP
  3. Gags

    Gags Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi Domen,
    i want to rewrite the urls http://www.sitename.com/network.php?ID=networkname to http://www.networkname.sitename.com.
    I completely dont know how to do it.
    now i am working on my local windows for testing.Is there any problem in using windows?
    can you plz explain me the process of rewriting subdomains, i didnt get the clear solution from anywhere :eek:

    Thanks
    Gags
     
    Gags, Sep 10, 2008 IP