Stop rewriting the index files in the pages array.

Instead of rewriting all the index files it uses their subdir name or in
case of the main index use base_url.