InMotion Hosting Support Center

WordPress media uploads displaying 403 error page

Category: Wordpress

standardtoaster
Asked:
2014-02-11 2:34 pm EST

Hits: 3,415
It seems all new media (picture) uploads on my WordPress blog are appearing as broken links. This started happening before I upgraded to version 3.8.1 but I didn't have a chance to address it.

When I try to access the uploaded picture directly, I come to a "Error 403 - Forbidden" page. Here is an example:
http://thatlovesong.com/?attachment_id=865

The strange part is, previously uploaded pictures unaffected; I do not come to a 403 error page. Here is the last uploaded picture before I started running into the 403 error (uploaded 11/18/2013):
http://thatlovesong.com/blog/2013/11/hope-for-the-dreamer/img_0128/

What have I done so far?
I checked the upload path folder (i.e. media) permission to ensure they are 750 and file permissions were 644.
I removed hotlink protection from the cPanel but that hasn't resolved the issue either.

Would you be able to help?

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

JacobIMH
Staff
9,968 Points
2014-02-11 2:59 pm EST
Hello standardtoaster, and thanks for your question.

I was unable to recreate a 403 error on the ?attachement_id=865 page.

Have you recently moved WordPress from a sub-folder to the root directory, or changed the Permalink settings? It would appear that your WordPress installation is off by a directory in some cases. The media files for your WordPress website reside in:

/public_html/media/2014/


However, it looks like from the website you're trying to call them from the directory:

/public_html/blog/media/2014/


At least I gathered this from the only requests I see in your access logs that are causing 403 errors.

[11/Feb/2014:10:16:54 -0800] "GET /media/2014/02/bestillandknow.jpg HTTP/1.1" 403
[11/Feb/2014:10:18:40 -0800] "GET /media/2014/02/bestillandknow.jpg HTTP/1.1" 403


If you'd like for us to take a closer look, please let us know URLs that you are having issues with, not ones that are working. For instance your /hope-for-the-dreamer/img_0128 URL, what is suppose to be the next one? As I don't see a img_0127 or a img_0129 one.

- Jacob

You must login before you can post a comment about this answer.

Hi Jacob,

That's strange - I'm not getting a 403 error on the ?attachment_id=865 page either. I'm unsure how this was fixed. I didn't move the WordPress blog from a sub-folder to the root directory, or change the Permalinks. I wonder if the folder permission changes needed some time to take effect?

At any rate, I'm still experiencing the broken image links problem with a secondary site. "The Living Room" was created from within the Network Admin Dashboard (www.thatlovesong.com/thelivingroom).

From "The Living Room" Dashboard>Media>Library, the following uploads are not displaying properly (broken image links). These are their respective pages:
http://thatlovesong.com/thelivingroom/?attachment_id=52
http://thatlovesong.com/thelivingroom/?attachment_id=43
http://thatlovesong.com/thelivingroom/?attachment_id=42

On any of these pages, I see a broken image link but if right click and "Open image in new tab" (I'm using the Chrome browser), I am taken to this URL:
http://thatlovesong.com/thelivingroom/media/sites/2/2014/02/livingroom.jpg

I'm unsure why it's requesting the image from the above URL since it's actually found here:
http://img.thatlovesong.com/sites/2/2014/02/livingroom.jpg

If it helps you to know, I created a subdomain to serve up images for the WordPress blog "That Love Song" by following these steps http://bit.ly/12FETaC.

I believe I need to update something for the "The Living Room" site to fix this... I just don't know what at this point.
standardtoaster
38 Points
2014-02-11 3:30 pm EST
Hello again standardtoaster,

It looks like you had submitted another question about WordPress media uploads prior to this one. It sounds like Arnel was able to fix your directory permissions and that's why neither of us were having issues accessing your original ?attachement_id=865 page.

It sounds like your current problems with the The Living Room site as part of your WordPress Multisite setup are coming from either incorrect paths in the database, or improper .htaccess rewrite rules.

I see that you have the WordPress WP Original Media Path plugin installed currently, this might be your problem. Do you know if you had that plugin correctly working on your WordPress Multisite installation prior to the missing images?

- Jacob
JacobIMH
9,968 Points
Staff
2014-02-11 4:23 pm EST
Please accept apologies about the double post.

I installed the WordPress WP Original Media Path plugin to see the path, but the plugin was installed yesterday and hasn't been a part of the troubles.

You're probably correct about incorrect paths in the database or improper .htaccess rewrite rules.
standardtoaster
38 Points
2014-02-11 4:32 pm EST
Hello standardtoaster,

I went back and read the tutorial you followed to setup your sub-domain image path and fixed the problem. It looks like because you're using a WordPress Multisite you already had the wp_options.upload_url_path option in your database set to http://img.thatlovesong.com.

However this was only set in your primary site's database tables. I went ahead and also updated that in your secondary site's specific wp_2_options table as well.

Please let us know if you're still noticing any issues at all.

- Jacob
JacobIMH
9,968 Points
Staff
2014-02-11 4:55 pm EST
I completely forgot I had to manually change the upload_url_path in my primary site's tables! The issues have been resolved. Thank you for all of your Jacob!
standardtoaster
38 Points
2014-02-11 5:03 pm EST
Hello standardtoaster,

Sure no problem at all, glad to help :)

- Jacob
JacobIMH
9,968 Points
Staff
2014-02-11 5:06 pm EST
Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!