I have modified etc/hosts to map app.website.local to my localhost 127.0.0.1. This works and it gets redirected to my localhost.
The problem is that
request.subdomain is empty, so i can't do anything with it.
# do something with the request
# here is request.subdomain empty
Ok I solved the problem myself. I took this project of somebody in the uk. There they use co.uk for domain names. He added the following config in development.rb
config.action_dispatch.tld_length = 3
Deleting this line solved it.