mod_rewrite entire directory to single file

  • caravan5
  • Novice
  • Novice
  • caravan5
  • Posts: 20

Post 3+ Months Ago

Hi all

I'm completely new to mod_rewrite so I'm struggling to know where to start on this. I'm wanting to redirect an entire directory to a single page.

So the old directory is:


and I want all requests for files within that directory to be redirected to:


I've read the mod_rewrite documentation from Apache, but most of it went over my head.

Any help would be greatly appreciated.

Thanks in advance
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6228
  • Loc: South-Africa

Post 3+ Months Ago

My mod_rewrite skills are limited, but maybe this would work:

Code: [ Select ]
RewriteRule ^olddirectory/([a-zA-Z0-9_/]+)$ newdirectoy/home.html

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 38 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.