• Hi

    I searched lot of – but all solutions what I find doesn’t work any more. I have latest stable WordPress and I need to have separated index.html file also in same directory where WordPress is installed (so index.html and also index.php files).

    index.html file is special age verification page (multi language – all free plugins what I tested – doesn’t give that simple yes/no solution – what is needed).

    Problem – when I am adding DirectoryIndex index.html index.php directive – then I can’t access to site even with sitename.com/index.php – I can see only index.html file. index.php is rewritten always to index.html.

    Solutions what I find and doesn’t work any more: in canonical.php file change the line: $redirect[‘path’] = preg_replace(‘|/index.php/$|’, ‘/’, $redirect[‘path’]); — this is deprecated and commented out now.

    Also – disabling canonical redirects – doesn’t work also: remove_filter(‘template_redirect’, ‘redirect_canonical’); – i added separated plugin or added that line to theme functions.php file – nothing.

    How its possible to have in same wordpress installation directory index.html and also index.php file?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You can do it, but to have it work you’ll need to remove index.php from the DirectoryIndex directive so that it’s not included in the tree. Just note that you might need to do this at a higher level than your local .htaccess file depending on how your hosting company has their server set up.

    Thread Starter spottraining

    (@spottraining)

    It doesn’t work.
    Only index.html file is showed and I can’t open wordpress

    No part of the DirectoryIndex directive should affect anything that WordPress does.

    What errors are you getting when you try to run the WordPress side of things?

    Thread Starter spottraining

    (@spottraining)

    Everything is redirected back to index.html file.

    There is some rewrite inside wordpress – as with normal php files I have made it many times.

    The first thing to do is look at your permalink settings. Anything apart from ‘Default’ should set up a .htaccess file to handle this, and that .htaccess file should point your server to index.php to handle everything.

    If it’s not doing that I’d suggest checking what is in the .htaccess file, maybe even in a php.ini file, and if nothing else stands out, contact your hosting company as they’ll know more about how their servers are set up them we do.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WordPress and index.html file together’ is closed to new replies.