Consistently use $wp_rewrite->index instead of hardcoding "index.php".

props wonderboymusic. fixes #7337