php redirect

Discussion in 'PHP' started by Joseph S, May 27, 2012.

  1. #1
    Joseph S, May 27, 2012 IP
  2. akhileshbc

    akhileshbc Active Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    5
    Trophy Points:
    75
    #2
    Try this:
    RewriteEngine On
    RewriteRule ^r/([a-z]+)/([a-z]+)/$ /\$1/?r=$2[L]
    RewriteRule ^r/([a-z]+)/$ /\?r=$1[L]
    
    Code (markup):
    The first one matched the URL with folder name. And the second one matches those without folder name.
    I haven't tested it. But I think it would work. :)
     
    akhileshbc, May 27, 2012 IP