开发者

Can't access my folder because of WordPress [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 10 years ago.

Improve this question

I 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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜