开发者

Wordpress - avoid opening php files as pages?

I have some php scripts in my Word开发者_运维百科press directory and I'm unable to use them. Why? Because Wordpress treat them as posts.

For example:

http://kaptinlin.com/themes/striking/wp-content/themes/striking/includes/sendmail.php

Points to a file and it works.

But on my site when i try to open /wp-content/themes/myTheme/anyDictionary/anyfile.php

it loads:

    Not Found

Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.

Page.

How to fix that?

Thanks


The default WordPress mod_rewrite rules look something like this:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

In essence, this says "pass all requests through WordPress, unless the request corresponds to a real file or directory." So, if you're seeing a WordPress delivered page when you expect the output of a non-WordPress script:

  1. Your rewrite rules differ from the default; paste them for help debugging. Or,
  2. The file may not exist where you think it does.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜