.htaccess help required

Discussion in 'Programming' started by akashif, Oct 21, 2007.

  1. #1
    hi

    i am playing with one script and that has a .htaccess file. i have understood almost complete code of that file except the following lines.

    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^profiles/([^/]+)/([^/]+)?$ /profile.php?u=$1$2 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^profiles/?$ /profile.php [L]
    
    Code (markup):
    i just need to know what this code is doing

    as per my understanding it should behave some thing like

    if i access a url like
    www.somedomain.tld/profile.php?u=Uname&q=show

    url will be re-writen as
    www.somedomain.tld/profiles/Uname/show/

    but i know i am wrong.

    can any one please explain me what is the logic of above .htaccess code.

    thanks
    akashif
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    akashif, Oct 21, 2007 IP
  2. jmhyer123

    jmhyer123 Peon

    Messages:
    542
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It rewrites the url's it's code for mod_rewrite it will make your script generate search engine friendly url's
     
    jmhyer123, Oct 21, 2007 Set Best Answer IP
  3. akashif

    akashif Guest

    Best Answers:
    0
    #3
    hi

    i know it will re write the urls , but my question is what will be final url after re writing if above code is in .htaccess file.

    anyway thanks reply

    thanks
    akashif
     
    akashif, Oct 21, 2007 Set Best Answer IP
  4. cyco99

    cyco99 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i think search engines can follow most dynamic urls now, if they want 2
     
    cyco99, Oct 22, 2007 Set Best Answer IP
  5. cyco99

    cyco99 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i think www.somedomain.tld/profile.php?u=Uname&q=show can be crawled fine now by google?
     
    cyco99, Oct 22, 2007 Set Best Answer IP
  6. xino

    xino Active Member

    Messages:
    298
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53