On the server there is a static HTML page example.html
in my root folder of the WordPress install. Now when a user types www.example.com/example.html
I want WordPress to be smart and bypass all normal routing behavior and instead just display that static example.html
page.
This looks so easy to me concept-wise but I can’t find a solution after looking for hours.
What exactly do I need to change in my .htaccess
file? Is it even that .httaccess
file or do I need to make such a change in the site available file?
Sorry for being a WordPress newbie 🙁
Here is what I have in my own
.htaccess
file that does what you’re looking for:If there’s no reason to bypass the routing you can follow the wp-hierarchy to accomplish this.
https://wphierarchy.com/
For example:
You could create a template-example php file within your theme, then within WordPress you would create a page and set it to the example template in the sidebar.
In your theme, this file would be called:
wp-content/themes/theme-name/template-example.php
OR
You could create a blank page within WordPress, set the slug to /example and then create page-example.php
This file would be located here:
wp-content/themes/theme-name/page-example.php
Here’s where you can find more information:
https://developer.wordpress.org/themes/template-files-section/page-template-files/
You can just use the Html block on the page then set it to your homepage like I did, https://sturtz.ml