Keeping Google rankings when moving from HTML to Concrete5
PermalinkA. Is there a tool for mapping HTML pages to Concrete5 pages in .htaccess?
B. Can I just do this by editing a copy of .htaccess and uploading it when I make my Concrete5 site live?
2. Websites take a day or two to propagate -- what should the order and timing be for:
A. Making the Concrete5 version of my site live
B. Changing the .htaccess file to redirect from the old HTML pages
C. Removing the legacy HTML pages from the server
Sample link:
www.www.example.com/index.php/dashboard/system/optimization/jobs/...
I moved my html pages to C5 in february 14.
In my .htaccess is a redirector to all "old" files ending with htm:
RewriteRule ^(axel.*)\.htm$ /axel/php/redirector.php [PT,QSA]
All requests to the new url were handled by c5 - old urls were redirected to the redirector. The redirector has the mapping (as array) "old url" -> "new url".
If a spider bots/ spider made the request, it sends a 301 derictly.
With that mechanism Google & co. learn the new url very quickly (1..3 days).
php snippet:
if ($sNewUrl){
if (
stripos($_SERVER["HTTP_USER_AGENT"], "spider")>0
|| stripos($_SERVER["HTTP_USER_AGENT"], "bot")>0
|| stripos($_SERVER["HTTP_USER_AGENT"], "wget")>0
|| stripos($_SERVER["HTTP_USER_AGENT"], "perl")>0
|| stripos($_SERVER["HTTP_USER_AGENT"], "www")>0
){
header("HTTP/1.1 301 Moved Permanently");
header("Location: $sNewUrl");
}
}
To Browsers it shows a user friendly message that the website was changed "Please update your link/ bookmark" and links to the new url (or if no match was found the link goes to the new starting page).
Axel
My redirect page additionally is tracked (I use piwik). So I can see if it does no traffic anymore and I can remove it if it not needed anymore.
1) Create your Concrete5 website on a subdomain or locally.
2) Create a list of all of your old website links, then next to each url put what your new URL will be in Concrete5. This will help you to create an accurate .htaccess file so that you don't miss anything later.
3) Create the .htaccess file that will go into effect when you deploy your new Concrete5 website. You can usehttp://www.rapidtables.com/web/tools/redirect-generator.htm... to help you generate each line of the file. Use the "Apache .htaccess redirect" option.
4) Deploy your new Concrete5 website and immediately after, add your .htaccess file so that your redirects start to take effect.
5) You can immediately remove / archive your old .html files
To be quite honest, I would probably create your Concrete5 website in a completely separate directory from your old website if this is possible for you. There is really no reason at all to keep those old .html file around after you have migrated to your Concrete5 website as long as your .htaccess file is in place with all of your redirects.