Changed replace to only remove blog/ or /blog/ at the start of the link
Changed check for main site to work if the main site is not the default
Merge pull request #1 from jedigo/master

Only remove /blog or blog/ at the start of the URL