Mod Rewrite help: site.com/?u=123 to site.com/u/123

Discussion in 'Apache' started by tin2mon, Oct 16, 2010.

  1. #1
    Hello Dear all,

    I am facing problem with mod_rewrite. I have a login system. User can login in to it. Now i want to give unique URL to each Member. i.e.
    i want to change
    <http://localhost/tintu/tintusdetail.php?user=test>

    Into
    <http://localhost/tintu/test/>

    how i can do it?

    NOTE: please don't give me any other link i have already gone through almost all links available on Net to till now. Just give me code so that i can paste it in my htaccess.

    Thanks in advance.
     
    tin2mon, Oct 16, 2010 IP
  2. fastdomains

    fastdomains Active Member

    Messages:
    409
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #2
    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^([a-zA-Z0-9_-]+)$ tintu/tintusdetail.php?user=$1&%1
     
    fastdomains, Oct 16, 2010 IP