Restricting access with “Options -Indexes” returns 404 instead of 403
-
I have a WordPress site and I want to block access to /wp-content and /wp-includes.
I have added this in .htaccess in the root folder: Options -Indexes
However, instead of returning 403:
For /wp-content it returns 200 with a blank page.
For all subdirectories in /wp-content (i.e. /wp-content/uploads) it returns 404
For /wp-includes it returns 404
What I’m expecting: I want to specifically block access to these directories and return a 403 Error and not a blank page or 404.What am I doing wrong?
Also, I want to make sure that just the /wp-content directory is blocked (and all the subfolders) and not the images inside the folder /uploads.
Will this negatively impact Google or any other search engine?
Can anyone help, please?
Added Options -Indexes in .htaccess and instead of returning 403 it returns a blank page or 404.
- The topic ‘Restricting access with “Options -Indexes” returns 404 instead of 403’ is closed to new replies.