Fix <=1.6 permalinks by fixing the .htaccess rewrite.
Fixes lbod/dapi#47.

Leaves the redirecting <script> blocks at the top of the 1.7+ files, so that permalinks
still work for offline API viewing where the user isn't running apache.