Forums

[resolved] Allow both index.php and index.htm to be accessed (3 posts)

  1. maidanet
    Member
    Posted 10 months ago #

    Often times, when I am setting up a new website, I will put an "under construction" page at index.htm

    Then I install Wordpress and can go directly to it by using index.php to view the pages.

    This has been working great for me for years.

    Now that I have installed 2.7, when I type index.php, it automatically directs me back to the root and the .htm file.

    This makes things difficult for testing.

    How can I allow access to both files without the index.php file being redirected to the root?

  2. Otto42
    Moderator
    Posted 10 months ago #

    You can remove the canonical redirection by adding something like this to your theme's functions.php file.

    remove_action('template_redirect', 'redirect_canonical');

    Note that you don't want to leave it this way permanently, it's bad for SEO to have the wrong URLs returning results. Duplicate content and all that.

  3. maidanet
    Member
    Posted 10 months ago #

    Thank you so much, Otto42. That works perfectly.

    It will be only temporary, until the site is approved and ready to go live.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.