Discussion: 301 redirect question
Afficher un message
Vieux 18/08/2006, 22h14   #3
Denise
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: 301 redirect question

"John Bokma" <john@castleamber.com> wrote in message
news:Xns9823A2DEF98C3castleamber@130.133.1.4...
Denise wrote: >
>> Can't quite figure this out, so thought I'd ask one of the 301 gurus
>> here ~
>>
>> What is the proper way to redirect all the pages in a particular
>> subdirectory to the homepage using a 301 without doing a 301 for each
>> page separately?
>>
>> For instance, every page in
>> http://www.example.com/something/ would redirect to
>> http://www.example.com (where one would find a note that the
>> /something/ part of the site unfortunately no longer exists).
>>
>> I tried this:
>>
>> RedirectPermanent /something/ http://www.example.com/
>>
>> and it works perfectly when someone types in
>> http://www.example.com/something - it redirects to
>> http://www.example.com

>
> Probably it first redirects to /something/ and then to
> http://www.example.com/ :-D


Yep! :-) That's what I meant, all right.

> Anyway (untested):
> RedirectMatch permanent /something/.* http://www.example.com/


Thanks so much. It works perfectly!

> See: http://httpd.apache.org/docs/1.3/mod...#redirectmatch


This is very interesting. I didn't know about (had never heard of)
RedirectMatch before. It's really going to come in handy; I can think of at
least one more situation where I can use it.

Thanks again, John! Somehow I just knew that it would be you that came to my
rescue.

cheers & gracias!
Denise

> John Experienced Perl programmer: http://castleamber.com/
>
> Googlebot Stats: http://johnbokma.com/perl/googlebot-statistics.html



  Réponse avec citation
 
Page generated in 0,06281 seconds with 9 queries