mod_rewrite: Redirect all index files to /

Discussion in 'Apache' started by hknight, May 27, 2010.

  1. #1
    Using .htaccess I want to redirect all requests from index files to the directory index.

    Anything that starts with "index." should be redirected to that directory index, including all sub directories.

    http://example.com/index.html
    Should redirect to:
    http://example.com/

    http://example.com/sub/dir/index.php
    Should redirect to:
    http://example.com/sub/dir/

    http://example.com/images/large/index.htm
    Should redirect to:
    http://example.com/images/large/
     
    hknight, May 27, 2010 IP
  2. soft-industry

    soft-industry Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello, try this one. It must to help you.

    rewriteRule ^index\.(.*)$ \

    If you need additional assistance in such matters, visit support.soft-industry.com

    Best regards
    soft-industry
     
    soft-industry, May 28, 2010 IP