[Techtalk] Moving Websites: 301 Redirect

chris chris.madrone at gmail.com
Sun Jun 6 18:25:34 UTC 2010


Hi Sue,
the internal anchor link is navigated by the visitor's user agent and will be ignored by mod_rewrite.  So, you'll likely need to redirect at the application layer rather than the server layer.  I would probably write a php function to detect the url + named anchor then redirect it to appropriate page.  

hth
chris


On Jun 2, 2010, at 8:09 AM, Sue Stones wrote:

> A simple rewrite that works is
> 
> RewriteRule ^(.*)$ http://www.redcockatooaustralia.com/ [L,R=301]
> 
> But when I try to duplicate this approach with something like the following not much happens
> 
> RewriteRule ^(.*)/artists\.php\#artsec$ http://www.redcockatooaustralia.com/artists/elly-chatfield/$ [L,R=301]
> 
> 
> I tried writing some with "RewriteCond" clauses, but I am not certain of the flow of control without them, so it seemed better to leave that out, until I had something working that I wanted to put conditions on!  Similarly I have no idea what %{HTTP_HOST} means and consequently when I need it, leaving it out made no difference so far. 
> Of course I have tried many variations on the lines above, but I am not much wiser!
> 
> Sue
> 
> 
> Sue Stones wrote:
>> I have rewritten a website and have moved it to a different domain - well at least that is what I am trying to do.  It sounded easy enough to set up a 301 redirect, but I haven't found any tutorials that explain it simply in the depth that I need.  For SEO reasons I need to redirect each page to the most similar page, and I can't work it out.  I can redirect the home page but am not getting beyond that.
>> 
>> Here is one page that I want to move:
>> 
>> http://redcockatooaustralia.com.au/artists.php#artsec
>> 
>> To:
>> 
>> http://www.redcockatooaustralia.com/artists/elly-chatfield/
>> 
>> Any ideas how I would do this?
>> 
>> Sue
>> 
>> _______________________________________________
>> Techtalk mailing list
>> Techtalk at linuxchix.org
>> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>> 
>> 
> 
> 
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk



More information about the Techtalk mailing list