My first attempt used changes to the htaccess
file , changing this
RewriteRule . index.php [L]
to this
RewriteRule . wpindex.php [L]
Then renaming the WP index.php
to wpindex.php
. My non-WP page could now be the index.php
page.
This worked. Until there was a WP core update.
An upgrade of WP will overwrite the index.php
page to the standard WP index.php
page, negating all of our work. And it’s possible that re-doing the Settings, Permalinks will overwrite the change to the htaccess
file.
So I changed my approach. I decided to rename my non-WP index page to landing.php
. Then I added this rule in the htaccess
file (outside of the ‘Begin/End WordPress’ area of the htaccess
file):
# Rewrite site root page to landing.php
RewriteRule ^$ /landing.php [L]
Now, accessing www.mydomain.com
will show the non-WP landing.php
page. That landing page can have links to other non-WP (or WP) pages.
Accessing a WP page with a slug of new-page.php
will be processed by WP to display that WP page.
I’d be interested in other approaches to this. One might be to convert the landing page to a template, and then creating a page using that template. Or creating a landing page within WP. In my case, the landing page has other ‘include’ functions (a popup contact form) that makes using a template or WP-built page a bit more difficult.