I migrated my wordpress blog posts from wordpress to jekyll hosted on github successfully. This was a lot of manual work. I decided to use a subdomain for my jekyll site, but the wordpress site was hosted on the main domain I needed to figure out a way to redirect any permalink from wordpress to

Jekyll was already aware of those permalinks used by wordpress, this was not an issue any more, but getting the .htaccessfile redirect the requests correctly was tricky, especially because and should not be redirect.

Searching the web for a solution was like searching for the needle in tha haystack. I tested some given solutions by others and came to the conclusion it is much easier to read the manual for mod_rewrite and tutorial sites myself and understand what it does.

But the real live saver was the online .htaccess rewrite rules tester


This are some of the URLs which needed to be rewritten

url rewrite


<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{REQUEST_URI} ^/blog/$
    RewriteRule ^(.*)$ [L,R=301,NC]

    RewriteCond %{HTTP_HOST} ^www\.feutl\.com$
    RewriteCond %{REQUEST_URI} ^/(.*)/$
    RewriteRule ^(.*)$$1 [L,R=301,NC]

.htaccess rewrite rules tester