Fixed page redirects with pretty URLs

When pretty URLs were enabled, "index.php" was preserved in the redirect URLs.

You can see this e.g. if you set a language section to the site and enable root redirection to the default language.