Static raw HTML page

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?

Read More

Sorry for being a WordPress newbie 🙁

Related posts

3 comments

  1. 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
    
  2. 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/

Comments are closed.