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 🙁
3 Answers
Here is what I have in my own .htaccess
file that does what you’re looking for:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^example.html$ /wp-content/raw/example.html [L]
RewriteRule ^download$ /wp-content/raw/download-ebook.html [L]
RewriteRule ^thanks$ /wp-content/raw/book-opt-in-thank-you.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress