Real htm files after rewrite - what to do ?

Discussion in 'Apache' started by wmg, Jan 26, 2006.

  1. #1
    1)I'm using mod_rewrite in a specific folder (events) that works like that :
    Options +FollowSymLinks
    RewriteEngine off
    RewriteBase /
    RewriteRule ^(.*)\.htm$ search.php?event=$1

    Ok, it works for new dynamic files, but in the same folder (events) i have real .htm files that are good indexed by GG... and with the new rules they can't be founded no more ..
    What to do ? Some idea ?

    2) which rule i need to rewrite the dynamc url like this :
    http://www.mwsite.com/events/view.php?type=1&date=13-1-2006
    TO
    http://www.mwsite.com/events/1-13-1-2006.htm

    Thanks for help
     
    wmg, Jan 26, 2006 IP
  2. Dejavu

    Dejavu Peon

    Messages:
    916
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #2
    1: ) put this before the rewriterule line:
    RewriteCond %{REQUEST_FILENAME} !-f

    It will prevent rewriting any files that actually exist
     
    Dejavu, Jan 26, 2006 IP
  3. wmg

    wmg Guest

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, Dejavu, works well..
     
    wmg, Jan 26, 2006 IP
  4. wmg

    wmg Guest

    Messages:
    22
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nobody answer the second question..but i find it .. :)
    here the correct rule :
    RewriteRule ^calendar-([0-9]+)-(.*)\.htm$ view.php?type=$1&date=$2
     
    wmg, Jan 27, 2006 IP