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?
The simplest is using
.htaccess
to make a file likehome.php
as the default index page. That would work best and would let you keep upgrading wordpress normally.http://httpd.apache.org/docs/current/mod/mod_dir.html
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 ..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’sDirectory
directive also apply to subdirectories. So if I seton my website’s dir, then
http://www.example.com/wp-admin/
will also implicitly reference the non-existinghttp://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:
The important bit here is line #4 where I insert
RewriteRule ^$ /home.php [L]
. That’s it!