.htaccess : Forward any link to /index.htm

Posted by Kevin on Stack Overflow See other posts from Stack Overflow or by Kevin
Published on 2010-04-13T19:55:36Z Indexed on 2010/04/13 20:33 UTC
Read the original article Hit count: 318

Filed under:
|
|

Hey all,

I'd like to do the following:

If a user gets to a url or types it in, and it is along the lines of any the following:

  • /path/path/path
  • /path
  • /path/path/

I would like htaccess to forward them to that url + /index.htm before triggering a 404. Also, I would like to ignore this rule for certain paths. Here is what I was trying and wasn't having success:

RewriteCond %{REQUEST_URI} !^(admin)
RewriteCond %{REQUEST_URI} !^(node)
RewriteRule ^/(.*)/$ $1/index.htm [L]

Here is how the app is outlined. It is actually a subdirectory within an application as the site is in transition at the moment.

ParentApp/
  /folder/
  /folder/
  /Drupal/
    /(new application here)
    /...
    /...

© Stack Overflow or respective owner

Related posts about .htaccess

Related posts about mod-rewrite