Magento Tutorials

Magento 403 Forbidden Error

magento-403-forbidden-error

Magento is one of the most flexible eCommerce platform available today. However, come along with its popularity, there are so many common errors which Magento users often face.

This post shows you more about the most common error: 403 forbidden

What is 403 Forbidden error?

403 Error or No Access Permission means that you do not have permission to view requested files or resources.

Why does it happen?

This issue occurs by any of the following reasons:

  • Incorrect File Permissions
  • “No Indexing” in .htaccess file is improperly used

How to fix 403 Forbidden error?

In Magento 1

  • Check file permissions

First, you will want to check the file permissions that each of your files has set. If a file or folder is set to “777” which is “world” writable for security reasons the 403 error will be displayed to protect your website from hacks. Folders should have the permissions set to “750” or “755” and files should be set to “644”.

If you have SSH Access, you can resolve this easily. Make sure you’re in the root directory of your Magento installation, and then execute the following commands:

find ./ -type f | xargs chmod 644
find ./ -type d | xargs chmod 755
chmod -Rf 777 var
chmod -Rf 777 media
  • Check “No Index” in .htaccess file

Once you have verified that all the permissions are correct but the issue still persists, you will need to check your .htaccess file. Keep in mind that you can have multiple .htaccess files in your account, so you may need to search / modify .htaccess files other than public_html/.htaccess. For example, if you have an addon domain located at public_html/addon_domain, you’ll need to check any .htaccess files within that folder as well. If one of the lines in the actual file says “Options All -Indexes” then simply remove “-Indexes” and save the file.

In Magento 2

Find your username with this command:

whoami

Then navigate and check if you have config for this user or create if it doesn’t exist:

cd
  1. Find your username with this command:
    whoami
  2. Then navigate and check if you have config for this user or create if doesn’t exist:
    cd /etc/apache2/user/
    touch <username>.conf

    Where username is an user name used to run Apache server.

  3. Add the following configuration (note that this is only for Yosamite):
    sudo vi /etc/apache2/user/<username>.conf

    Add the following content:

    <Directory "/Users/<username>/Sites/">
    AddLanguage en .en
    LanguagePriority en fr de
    ForceLanguagePriority Fallback
    Options FollowSymlinks Indexes MultiViews
    AllowOverride All
    Order allow,deny
    Allow from localhost
    Require all granted
    </Directory>
  4. Add lines in the /etc/apache2/httpd.conf configuration file:
    sudo vi /etc/apache2/httpd.conf

    Check and uncomment the line:

    Include /private/etc/apache2/extra/httpd-userdir.conf
  5. In the httpd-userdir.conf file ensure to uncomment line:
    Include /private/etc/apache2/users/*.conf
  6. Restart Apache server
    sudo /usr/sbin/httpd -k restart
apache2/user/
touch <username>.conf

Where username is an user name used to run Apache server.

Add the following configuration (note that this is only for Yosamite):

sudo vi /etc/apache2/user/<username>.conf

Add the following content:

<Directory "/Users/<username>/Sites/">
AddLanguage en .en
LanguagePriority en fr de
ForceLanguagePriority Fallback
Options FollowSymlinks Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from localhost
Require all granted
</Directory>

Add lines in the /etc/apache2/httpd.conf configuration file:

sudo vi /etc/apache2/httpd.conf

Check and uncomment the line:

Include /private/etc/apache2/extra/httpd-userdir.conf

In the httpd-userdir.conf file ensure to uncomment line:

Include /private/etc/apache2/users/*.conf

Restart Apache server

sudo /usr/sbin/httpd -k restart

 

See more:
Magento 2 Error: One or more indexers are invalid
Warning: Your Magento folder does not have sufficient write permissions

Magento 403 Forbidden Error
5 (100%) 1 vote
1 Comments

Dom

A knowledge craver who always strive to be wiser everyday.

    1 Comments

    1. Magento Service Temporarily Unavailable - M commerce blog - SimiCart
      11/24/2017 at 12:36 am

      […] more: Magento 403 Forbidden Error There has been an error processing your […]

    Reply your comment

    Your email address will not be published. Required fields are marked*