Try to prefer index.php over index.html in the same directory

Add JS redirect if that fails (HTTP-based redirects are disabled by
default in more recent Firefox versions).