Can't access my folder because of WordPress [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this questionI have installed my WordPress on my website and I'm u开发者_如何学运维sing 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?
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.
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)
精彩评论