Well yes, WordPress doesn’t play nice with sub-directories initially, however there is a way to change that.

As a default setting, Wordpress sites answer all “Page Not Found” or 404 requests with a built-in WP response page. That’s awesome. It’s convenient for the visitor as it provides a response and maybe even a menu of recommended pages. While WP is doing its job, it will also answer any request to a sub-directory in the same manor – with “Page Not Found.”

Now, you know, for a fact, that you made a working sub-directory. You can see the directory with FTP or at the server’s command line. There it is!!! How frustrating. Well, after all, WP is doing its job and that is good security. So we can’t blame WP for doing what it’s told to do.

What if you wanted WordPress to continue addressing these “Page Not Found” requests and still go to your new sub-directory? Here is how that can be done:

Work with your site’s .htaccess file. Yes. Edit that file.

Now, I always back up a file by copying it to a new name with the date in the filename. Please do this too. It  will save you much grief in the future becuase if mistakes are made, you can always copy the backup file over your edits. (link to post about editing files and saving a backup)

Now that you copied the original .htaccess file, let’s edit it with the following:

(new file content)

And  look! WordPress allows you to go to the new sub-directory with no interruption! Wow!

But wait! What if you wanted to password protect this sub-directory?

So you create an .htaccess file (link to how to do this) that password protects this sub-directory. And you test it out and WOW what is Worpress doing? It’s resolving this new password protected sub-directory as a “Page Not Found” again! What just happened?

WordPress actually is resolving your sub-directory properly. It just happens that the server is now trying to resolve the resulting 301 page request for password protection. It happened so quickly that one would think that we went right back to the original problem and that the sub-directory is no longer being resolved. Almost as if WP is defying our wishes. However, that is not the case and you don’t have to edit the site’s .htaccess file in the Web root again. Wheph!

Here is how to resolve the 301 password request (the next step):

Edit the sub-directory’s .htaccess file with the following:

(new file content)

And, there you go. Now you have WordPress answering all of these requests properly:

  • 404 Page Not Found
  • Subdirectory
  • 301 password protected area login request