Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect example.com to www.example.com using Heroku (rails) and Cloudflare

How would one setup a redirect from example.com to www.example.com using Heroku and Cloudflare?

like image 670
Marc Avatar asked Jan 23 '26 23:01

Marc


2 Answers

It's not something that you can do at CloudFlare since they now host the DNS for your domain and don't support redirects so it's something you'd have to do at the application level.

http://support.cloudflare.com/discussions/questions/259-redirect-to-www

like image 137
John Beynon Avatar answered Jan 26 '26 13:01

John Beynon


One free way to do it is to use the Naked Domain Redirect from wwwizer.com. You just make an A record for example.com to 174.129.25.170 (you can do that from Cloudflare). wwwizer will then redirect the request to www.example.com. It's probably the easiest way that I know how to do it.

like image 40
GorrillaMcD Avatar answered Jan 26 '26 14:01

GorrillaMcD