mod_rewrite to index.htm

Discussion in 'Programming' started by caveman2, Feb 13, 2011.

  1. #1
    am trying to have mod_rewrite redirect to a index.htm cache file if it exists.

    the url is something like
    http://mysite.com/section/category/

    if the cache file:
    http://mysite.com/section/category/index.htm
    exists then it should go to that. otherwise proceed with other rewrite rules

    have spent hours trying to do this and am thoroughly brainfried. any ideas?

    have tried the below:


    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_FILENAME}index\.htm -f
    RewriteRule . - [L]

    the first line works but and it detects as a dir but second line doesnot do the redirect even though the file exists.
     
    caveman2, Feb 13, 2011 IP
  2. caveman2

    caveman2 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    also added the line:
    DirectoryIndex index.htm index.php
    but did not make a difference
     
    caveman2, Feb 13, 2011 IP