mstearne's Avatar
mstearne 4
5 Asked
1 Answered
0 Best
0
No one has voted on this question yet :(
1 year, 6 months ago

WordPress: Files ending in .php in the wp-content/plugins/ directory are treated as Not Found

For some strange reason every file I attempt to access in my WordPress installation inside the wp-content/plugins/ directory and underneath return a WordPress based 404 error. The files appear in directory listings...

like this: http://technologysolved.ca/wp-content/plugins/store-locator/js/

when other files types (.js and .html) are clicked they work correctly. But when a file like: the store-locator-js.php is clicked WordPress returns a 404 style error.

This happens with all .php files in the plugins directory and below.

I believe this may be some kind of .htaccess more mod_rewrite error but I am not sure.

My .htaccess file is the following...

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - L
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 L
RewriteCond %{REQUEST_FILENAME} -f OR
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - L
RewriteRule . index.php L

Any help would be appreciated. Thanks!
Tip for best answer: M$10.00
Separate topics with commas, or by pressing return. Use the delete or backspace key to edit or remove existing topics.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

What is Your Answer?

0
0
0

4 Answers

1
jkgrant's Avatar
jkgrant | 1 year, 6 months ago
4
The htaccess does control a lot of your permissions as far as being able to access those files directly, how ever i would not change it for security reasons. It is that way to protect your wordpress site. Now i would suspect that the files were uploaded in ANSI mode. Try setting your FTP client to upload only in Binary Mode and see if that fixes any issues with the plugin working correctly. Also please remember that the php.ini and the apache settings limit how much can be uploaded via the wordpress admin section, and this could be causing the files to be corrupted. If you think that is the case then get an FTP client and upload the files directly in Binary Mode and again the issue should be fixed. Take into account the the htaccess file is still going to prevent you from going directly to those files via a web browser. Again it is security related.
If you need to view the files your only recourse is to open in your browser from your desktop before you upload them. They will not function properly however due to the fact that they are not in a live environment but you can peek at some of the way it looks. Again the htaccess is there for the protection of your site and I would not make any changes to is as it would compromise site security.
I hope this helps and i am here if you need anything more

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
shubhkarman's Avatar
shubhkarman | 1 year, 6 months ago
4
Try changing your .htaccess file to:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - L
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php L

# END WordPress

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
tracebooks's Avatar
tracebooks | 1 year, 6 months ago
17
What plugins are you using? And what are your permission levels? I know this is not an answer, but sometimes having this information can help troubleshoot.

When you go in from the server side, are files actually there or not? You may need to re-upload the plugin(s). I once had one missing bracket break the entire site, and it was not a bracket I myself removed, but a corrupted file.

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel
0
rinatisdinoro's Avatar
rinatisdinoro | 1 year, 6 months ago
3
Your .htaccess should look like this I think

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - L
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php L

You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.

M$

Report Abuse

Post Reply Cancel

Learn something new with our FREE educational apps!

Private lessons in the comfort of your own home. Get back in shape or finally pick up a guitar with our great experts guiding you the whole way!
Learn Guitar
Learn Hip Hop
Learn Pilates