If you installed WordPress in your root directory, there is a good possibility you may have lost access to other files and directories. WordPress’ rewrite rules may have prevented you from accessing those files. Instead, it’s displaying 404 errors.
To fix this issue, you will need to insert a line of regular expression code in your .htaccess file that will exclude your files and directory from being rewritten.
A typical WordPress .htaccess may look like this.
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] |
Here’s the new .htaccess that will exclude certain directories.
RewriteEngine On RewriteBase / <strong>RewriteCond %{REQUEST_URI} !^/(foldername|foldername/.*)$</strong> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] |
It’s a simple fix, but it can be frustrating if you don’t know what’s going on.