3

I have installed my WordPress on my website and I'm using permalinks, but I have a folder called x in the main root of my website I can't access it now when I type http://mywebsite/x it redirects me to error 404 not found. That's because WordPress is trying to fitch the story that called x in the database. How can I exclude that folder and its childern "folders" from wrodpress calculations?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
trrrrrrm
  • 11,362
  • 25
  • 85
  • 130

2 Answers2

3

The .htaccess file in the root of your website's directory contains a RewriteRule which redirects every incoming request to Wordpress's bootstrapper. It probably looks something like this:

RewriteRule ^(.+)$ index.php?$1 [QSA,L]

You should add two Conditions to this Rule. These conditions provide exceptions that make sure the Rule is only executed if there is no (!) file (-f) or no directory (-d) available that matches the requested URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?$1 [QSA,L]

That should do the trick.

Martijn Heemels
  • 3,529
  • 5
  • 37
  • 38
  • Tried this solution, but it is not working. Could you please take a look at this thread? https://stackoverflow.com/questions/48809023/unable-to-upgrade-zencart-because-wordpress-is-not-allowing-to-access-subfolder – Biju P Dais Feb 16 '18 at 12:35
0

check .htaccess file, that could be a problem. (redirection if page does not exist, in your case, http://mywebsite/x/index.html or .php does not exist)

slobodan
  • 199
  • 1
  • 4