|
Posted by Curtis on 02/17/07 06:56
Rik wrote:
> On Fri, 16 Feb 2007 19:36:18 +0100, <mariusz@polbank.info> wrote:
>
>> Hello
>>
>> I want to redirect www.mysite.com/aaaa/p1/p2/p3 to www.mysite.com/bbbb/
>> p1/p2/p3,
>> because Google has indexed sites with 'aaaa' and 'bbbb'. But they are
>> the same sites.
>>
>>
>> I can't do it in .htaccess file becasue I'm taking p3 parameter from
>> mysql database.
>
> Why not?
>
> RewriteEngine On
> RewriteRule ^/aaaa(.*)$ /bbbb$1 [L,R=301,QSA]
> --Rik Wasmus
mod_rewrite is not always needed, and should be avoided, when
RedirectMatch will do. Apache has the very cool RedirectMatch directive.
RedirectMatch seeother ^/aaaa(.*)$ http://www.mysite.com/bbb$1
Navigation:
[Reply to this message]
|