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:

www(dot)mysite(dot)com/olddirectory

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

www(dot)mysite(dot)com/newdirectory/home.html

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
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • 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: demonmaestro, VanessaGilbert and 133 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-2014. Ozzu® is a registered trademark of Unmelted, LLC.