0

Hey guys I'm not sure how to phrase this to get the correct search, so here goes i would like to redirect all queries for /directory/index.html to /directory/ which is (really) /directory/index.php I wrote this out but it inserts my entire web root structure (/var/www/html/directory/index.php) so it's a no go, maybe someone could help me a bit? Does this make sense?

here's the code

RewriteEngine On

RewriteRule ^index.(htm|html?)$ ^index.php [R=301,L]

EDIT

I solved it with this, but I'm sure theres a better way?

RewriteEngine On

RewriteRule ^index.(htm|html?)$ %{REQUEST_URI}/../index.php [R=301,L]

Community
  • 1
  • 1
ehime
  • 8,025
  • 14
  • 51
  • 110

1 Answers1

0

This might work (and is cleaner, I think):

RewriteEngine On
RewriteRule ^index\.(htm|html?)$ /index.php [QSA,NC,R=301,L]
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213