I have a portfolio site that I would also like to make a demo site for some of my client work. Basically, I would like to serve a subfolder statically along side the WordPress install. For instance, if I have http://example.com/demo/subfolder/index.html that index file would be served directly from Apache rather than WordPress. I have root access to my server, just not sure how to implement this


If the files are static HTML, then you only need to be concerned with name collisions for the directory structure. And if you don't have anything in WordPress that generates /demo/subfolder/ you don't have to worry about ignoring it - it's already ignored.

I have a sandbox folder that I use for a similar purpose as you and haven't had to implement anything - It's ignored by WordPress already.


For anyone with the same question, you can use my plugin available at Wordpress repository: WP Custom HTML Pages

It allows you to serve static HTML pages at custom URI of your choice.

1) Install and activate the plugin

2) Use the new submenu item (Pages->HTML Pages) to create a new HTML page

3) In "Page Permalink" field enter the custom URI you wish to assign to your page, for example /my-html-page (at the time of writing this answer, it is required that the value you enter starts with "/" character) and in "HTML Page Code" field enter all the HTML and CSS of the page document that you wish to display

4) Click "Publish" then go to yourwebsite.com/my-html-page and you should see your static HTML page, providing its status is set to "published"

By creating and linking several pages you may have a whole static website.


You can request WordPress to ignore the subdirectory structure by adding these rules in .htaccess. Add them within <Ifmodule mod_rewrite.c> But generally if there is no page such as demo, WordPress ignores it and the static page is rendered.

RewriteCond %{REQUEST_URI} ^/Demo_directory/(.*)$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.