Reputation: 5121
I have a website built with wordpress and uploaded on a linux server. It's been working fine for a long time, but yesterday my website started giving me 403 forbidden errors while loading image resources.
But when I open that resource in a new tab, it gets loaded successfully. Then I go back to my website, refresh it, and that particular image gets reloaded now.
I don't know what's going on. I need help.
Upvotes: 2
Views: 17140
Reputation: 4433
Incorrect file permissions can cause 403 forbidden error. It makes your web server think that you do not have permission to access these files.
All folders on your WordPress site should have a file permission of 744
or 755
.
All files on your WordPress site should have a file permission of 644
or 640
If you have ssh access you can change permissions using this command:
chmod -R 755 /var/www/html/yoursite
If you are using a ftp client like Filezilla you can select a folder, right click and then select File Permissions from the menu.
Also the 403 error is caused by a corrupt .htaccess
file in your WordPress site.
You can generate a fresh .htaccess
file by logging into your WordPress admin area and going to Settings » Permalinks
page.
Upvotes: 8
Reputation: 100
403 stands for permission denied. You need to check the permissions for those image.
Upvotes: -1