FIX: Wrong URL rewriting function in application.js