Hey people,
I am in the process of redoing a website, however this time with quite a bit of attention towards SEO optimisation. My task is simple to migrate the search engines as smoothly as possible. I would like a 301 redirect from an old page hard link to the new page hard link (although doc id stays the same). I have found a plug-in called NG!Redirect (gives the ability to move hard link to hard link) and Missing (gives the ability to move old hard link to ID), unfortunately non of them seemed to work for me. Any ideas? I had also found a snippet posted by scrafy96 (so all credit goes to him:p)
<?php
$redirect = array(
'/directory1/' =>2438,
'/directory1/index.html' =>2438
);
$referring_url = getenv("REQUEST_URI");
#echo 'Referring url = '.$referring_url.' redirecting to :'.$redirect[$referring_url];
if (isset($redirect[$referring_url])) {
$modx->sendRedirect($modx->makeUrl($redirect[$referring_url], '', '', 'full'), 0, 'REDIRECT_HEADER', '301');
}
?>
The way this snippet should work is basically call the snippet [[redirect]] on the 404 page and it should redirect a page if it finds it unfortunately it did not work for me - I tried calling hard-links and ids but again no luck:(
I know there is a way to use .htaccess for the redirect i.e:
Redirect 301 /old.html http://www.blabla.com/new.html
How ever as I am using FURL (and have to use it)
Redirect 301 /old.html http://www.blabla.com/new.html
Does not work, the only way I could get this to work is
Redirect 301 /old.html http://www.blabla.com/?q=PAGEID
But this redirect to a url
http://www.blabla.com/?q=PAGEID instead of
http://www.blabla.com/new.html
*GULP*... any ideas?
EDIT: just found this plug in
http://www.stanback.net/code/modx/virtual-aliases.html but I have no idea how to insert the links other than that they go into a tv... No info given on site:(