We recently launch
custom domain features in our product: Logdown, a Markdown Blogging Platform.
People keep asking me how to implement, here is how :
(1) Constraint Routing
If it doesn't match
www.logdown.com, then it goes straight to the constraint routing.
(2) Find Current Blog
PostsController, we also build a method
find_blog to find
The sequences will be :
custom domain =>
(3) Nginx Setting
The code is very simple, but it tooks me lots of time to figure out...