Redirect user to canonical URLs

Setup the following redirects with JavaScript:
  1. If a user visits /index.html via an HTTP or HTTPS URL, then
     redirect the user to /.
  2. If a user visits www.quickqwerty.com, redirect the user to
     quickqwerty.com.