2

I am redoing an old static html site in WordPress and that's all fine, but there is a section of the site that is in a subdirectory that would be fine to keep the static html.

I am building the WordPress site in a subdomain and am wondering if, when I move the subdomain site to the main domain, there is a way to keep the certain section as it is and just have it alongside the WordPress part of the site?

My intuition says I'll have to redo it in WordPress but thought I'd ask here as it would save a lot of time if possible.

2

It is possible and WordPress is set up by default to allow static files. WordPress uses a front controller to have index.php handle all the URLs. But it has an exception for any static file that actually exists.

The code WordPress uses in .htaccess to do this is:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

The !-f and !-d are exceptions for not a file and not a directory respectively.

To get this to work, all you have to do is upload your static subdirectory into your website's document root beside index.php and it will work fine.

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.