[pmwiki-users] Mediawiki to PmWiki migration - how to preserve old links

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 12 20:48:58 CST 2007


On Sat, Jan 13, 2007 at 12:40:36AM +0000, Andrew Fyfe wrote:
> Patrick R. Michaud wrote:
> > On Fri, Jan 12, 2007 at 10:39:06PM -0000, Crisp, Steve [UK] wrote:
> >>    Existing MediaWiki URL:
> >>    http://wiki.enginuity.org/index.php?title=Frequently_Asked_Questions
> >>     
> >>    New PmWiki URL (temporary site!):
> >>    http://scoobypedia.co.uk/enginuity/index.php/Enginuity/FrequentlyAskedQuestions
> >
> >     <?php
> >       $title = @$_REQUEST['title'];
> >       header("Location: http://scoobypedia.co.uk/enginuity/index.php/Enginuity/$title");
>
> You should also send the proper HTTP response header, it won't make much 
> difference for normal users, but for search engines will now that the 
> new location is the same page (keeping it's page rank) rather than 
> reindexing it as a new page (starting with a 0 page rank).

Using the Location: header causes PHP to automatically return
"302 Found" as the status code.  This is generally okay, and
probably the best thing to do until everything is set up and
the site is certain that the url redirection is in fact permanent.

But you're correct, that once the urls are permanently changed
it'd be good to add

    header('HTTP/1.1 301 Moved Permanently');

to the script.

Thanks!

Pm




More information about the pmwiki-users mailing list