• Resolved mombasa2005

    (@mombasa2005)


    Hello,

    I have an existing static website, which uses index.html has the default page. Now I’m developing a WordPress site which I need to test but I don’t want the public to access when they go to https://www.mycompany.com. I want to be able to access the test website via https://www.mycompany.com/index.php. (I’m ok if the public can access this page by typing in this URL.)

    What changes do I need to make in my .htaccess file? I tried putting:

    DirectoryIndex index.html

    …without listing index.php, but when I go to https://www.mycompany.com/index.php, it goes to my index.html page instead of my WordPress page.

    How do I remove index.php as one of the default “index” pages?

    Thanks for the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, Please place this code in your theme function file and you can access both index.html and index.php file.

    remove_filter('template_redirect', 'redirect_canonical');

    Thread Starter mombasa2005

    (@mombasa2005)

    Hi iqbalbary,

    Thank you! That worked.

    Just a note to self: Theme function file is found in WordPress Dashboard > Appearance > Editor > (on right sidebar) Theme Functions (functions.php).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Access index.php page manually, not through root URL’ is closed to new replies.