Skip to main content

Migrating from Wordpress to Silverstripe

This blog post might be outdated!
This blog post was published more than one year ago and might be outdated!
· One min read
Stephan Hochdörfer
Head of IT Business Operations

A couple of weeks ago we relaunched our new website. In addition to that we decided to relaunch our blog as well. Since we wanted to use Silverstripe as CMS for our main website it made sense to use Silverstripe as a basis for our blog as well. Luckily there exists a blog module for Silverstripe which made it pretty easy to set-up this blog. The migration was no-brainer: Export the existing Wordpress content as XML file and import the XML file into Silverstripe via the wordpressimport module. The documentation of the wordpressimport module said it would be enough to add the following RewriteRule to the .htacess file:

RewriteRule ^[0-9]{4}/[0-9]{2}/(.*)$ /blog/$1 [R,L]

As it turned out this was not enough. We had to add the following rules to make sure all "old urls" can be reached without any problems:

RewriteRule ^([0-9]{4})/([0-9]{2})/$ /blog/date/$1/$2 [R,L] 
RewriteRule ^[0-9]{4}/[0-9]{2}/[0-9]{2}/(.*)$ /blog/$1 [R,L]
RewriteRule ^category/(.*?)/page/([0-9]+)/$ /blog/tag/$1 [R,L]
RewriteRule ^category/(.*)$ /blog/tag/$1 [R,L]
RewriteRule ^tag/(.*)$ /blog/tag/$1 [R,L]
RewriteRule ^page/(.*)$ /blog/ [R,L]