Now that my blog is on Rails I can do a couple of nice things that I couldn’t do with other blog-platforms. I have been using “blog.ronnylam.nl” for a couple of years now, but am not doing anything with the root-domain “ronnylam.nl”. Today I thought it was about time to move my blog to the root-domain and redirect “www” and “blog” with a 301 permanent redirect to the root.
For that I used Rack::Rewrite, but because I have been troubleshooting a Heroku application error I want to share the setup. In the
octopress directory I did:
Then I put the following in
1 2 3 4 5 6 7 8 9 10 11
This sends a
301 to everyone that goes to something else then
ronnylam.nl. But the nice thing is that it rewrites the URL to the original directory the reader was going to.
Of course a
git push heroku master puts it all in the cloud.