Sometimes you type a hash-bang URL too fast, bang first.
https://artsy.net/!#/log_in. Rails will receive
/! as the file path, resulting in a 404, File Not Found error. The part of the URL after the hash is a position within the page and is never sent to the web server.
It’s actually pretty easy to handle this scenario and redirect to the corresponding hash-bang URL.
The most straightforward way is to create a file called
!.html in your
``` html public/!.htmlClick here if you're not redirected ...
You can also do this inside a controller with a view or layout. Start by trapping the URL in your `ApplicationController`. ``` ruby app/controllers/application_controller.rb if request.env['PATH_INFO'] == '/!' render layout: "bang_hash" return end
``` ruby app/views/layouts/bang_hash.html.haml !!!