need help for mod_rewrite in .htaccess

Discussion in 'Apache' started by tmd_raju, Mar 7, 2007.

  1. #1
    need to redirect the url for ex:

    the i/p url is http://xyz.com/virtualfolder/?var1=value1

    i have .htaccess file in xyz.com/

    considering the virtual folder,when we hit the url it should automatically redirect to the file in the physical folder ie:it should execute a file http://xyz.com/physicalfolder/index.php where the i/p url should not change.

    i tried a lot with mod_rewite but nothing turned positive,any help will be very thankful.
     
    tmd_raju, Mar 7, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    Post how you want the URL, like

    xyz.com/var1/value1.html
     
    Nintendo, Mar 7, 2007 IP
  3. tmd_raju

    tmd_raju Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the url should be like the i/p url only

    if the i/p url is http://xyz.com/profile/?name=test

    it should execute xyz.com/member/profile.php,i used the rewite rule as

    RewriteRule ^profile/(.*)$ /members/memberProfile.php?username=$1 but i dont know why this is not working.

    Any global config is needed for the server??.
     
    tmd_raju, Mar 8, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    That's only correct if

    domain.com/members/memberProfile.php?username=ANYTHING

    is the original URL

    domain.com/profile/ANYTHING is the new URL.

    domain.com/profile/index.php?name=test
    is the original URL. What do you want the new URL to be for that?

    domain.com/members/memberProfile.php?username=ANYTHING
    and
    domain.com/profile/index.php?name=test

    arn't the same thing.
     
    Nintendo, Mar 9, 2007 IP