D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] htaccess regex question

 

Hi Dave,

On Sun, Aug 19, 2007 at 06:59:26PM +0100, Dave Morgan wrote:
> My current .htaccess file -
> 
> Redirect 301 /topmenu.html /topmenu.php
> Redirect 301 /books-az.html /books.php
> Redirect 301 /goodsinwards.html /gallery2/main.php/v/4801pics/
> Redirectmatch 410 ^(/gallery/)*
> 
> The top three lines work,  but the bottom line does not.
> 
> What should I have put on the bottom line to get it to match all
> paths starting /gallery/ ?

I think you want:

RedirectMatch permanent ^/gallery/.*$ /gallery2/main.php

or:

RedirectMatch gone ^/gallery/.*$

Cheers,
Andy

-- 
http://bitfolk.com/ -- No-nonsense VPS hosting
Encrypted mail welcome - keyid 0x604DE5DB

Attachment: signature.asc
Description: Digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html