• In the root directory of my server I have a WordPress install and a handful of sub-folders. One sub-folder in particular I need to setup a 403 Forbidden error to anyone who tries to access it. The problem is that rather than show the server’s default 403 page (with just black text on a white screen), it redirects me to the 404 page of my root WordPress install. The folder has nothing to do with WordPress so I would really like it not to do this. Is that possible!?

Viewing 1 replies (of 1 total)
  • If the sub-directory doesn’t contain an index file of any type, then you could try adding Options -Indexes to the top of your .htaccess file. That prevents casual browsing of all directories and should return a 403 Forbidden error if accessed directly.

    If you don’t need to guard against casual browsing of all directories and only want to deny access to one sub-directory, you might try placing place an .htaccess file inside of that folder (the one you want to protect) and then add Deny from all to it. That should probably return a 403 for that directory.

    You might also be able to use the configuration tools in your hosts control panel to password protect just that directory if you still need access to it from a browser for other reasons.

    I imagine there’s probably a few other solutions out there as well.

Viewing 1 replies (of 1 total)
  • The topic ‘Stop Redirecting 403 to WP 404 Page’ is closed to new replies.