Make WordPress run everything BUT the homepage

We’re launching an online application which is basically nothing but a static index.php with a Flash embed in it. We also want to add an FAQ page and a blog. So in addition to https://www.example.com (the application), we’ll have the https://www.example.com/faq static page and https://www.example.com/blog.

The FAQ and the blog can be run by a WordPress installation but we’d like to keep the application itself running from our simple index.php (to avoid the WP overhead, for one thing). The question is, is it possible to install WP in such a way that the homepage is run by our original index.php but everything else is either WP static pages or the blog?

Related posts

Leave a Reply

3 comments

  1. I do not really understand why you would need wordpress for such a “static” site, but anyhow, one solution could be to install index.php in the root ( e.g. http://www.myapp.com ) and then give wp it´s own folder ( http://www.myapp.com/wp/ ), but maintaining the blogurl and homeurl as that subfolder ( http://www.myapp.com/wp/ ).

    In this way you would have actually 2 indexes, one of your main application ( http://www.myapp.com/index.php ) , and one in the subfolder ( http://www.myapp.com/wp/index.php ).

    They will operate as total different application easily linked .

    There are of course a ton of other ways to do it , ( for example just make a special home.php template file – while not eliminating the index the result will be the same ) or just define that other page as a static home page , or with redirects… all depends on what exactly you want to achieve and how ..

  2. While the solution in the accepted answer works, it causes URLs such as http://www.example.com/wp-admin/ lead to 404 errors. The problem here is that any statements within Apache’s Directory directive also apply to subdirectories. So if I set

    DirectoryIndex home.php
    

    on my website’s dir, then http://www.example.com/wp-admin/ will also implicitly reference the non-existing http://www.example.com/wp-admin/home.php.

    The solution that worked for me is actually quite simple and required minimum modifications to the .htaccess generated by WordPress itself:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^$ /home.php [L]
        RewriteRule ^index.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
    </IfModule>
    

    The important bit here is line #4 where I insert RewriteRule ^$ /home.php [L]. That’s it!