D&C GLug - Home Page

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

Re: [LUG] htaccess regex question

 

On Monday 20 August 2007 16:01, Andy Smith wrote:
> 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
The first think a bot should do when searching a web site is go get 
www.website.dom/robots.txt  - this file tells the bot where it can and cannot 
go - you dont want a bot running all your cgi-bin files etc...
Its best to set this up to disallow everything and enable only those bits of 
your site that are relatively permanent otherwise you'll be trying to 
redirect every last page you ever write.
.htaccess should be used for security and 'housekeeping' and should not be 
used for fending of search engines
Tom te tom te tom



-- 
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