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:
- Your rewrite rules differ from the default; paste them for help debugging. Or,
- The file may not exist where you think it does.
精彩评论