I get a 403 forbidden when I visit my site or url
Back to web hostingThe (403) forbidden error message can have several causes.
In most cases, this error message appears when there is no index file in the folder.
The error message looks like the following:
Possible causes:
No index.htm or index.html or index.php file present.
Upload an index.htm / index.html or index.php file via ftp.
You may get this error message after installing a (WordPress) plugin.
In that case, try disabling the plugin by renaming the plugin's folder in ftp in the wp-content/plugins folder. This will prevent files of the plugin from executing and wordpress will deactivate the plugin.
After installing an SSL certificate, the folder location is changed
Once you install an SSL, you may find that the folder is automatically changed to the private_html folder, for example. In some cases there are no files in there, resulting in a Forbidden.
There are 2 options to solve it.
- Put files in the private_html folder
- Change the folder and set the default folder to the public_html folder
Often you can specify in the domain settings within the control panel that it should be instead of the private_html folder.
In directadmin you can set this at Account manager, Domain settings and then click on your domain name, at the top right you will see an option: set private_html. If you click on that you can click the option: "Use a symbol link from private_html to public_html - allow the same data in http and https".
It will now pick up the public_html. Note that this action will delete the current files that are in the private_html.
It is also possible that an index file is present, but that it does not have read permissions, for example.
Each file has its own permissions, which you can manage.
Permissions can include read, write and execute and are also expressed in numbers.
The default for files is 644 and for folders is 755.
If you keep these permissions, the website should function normally.
You can set the permissions yourself, you can do this via a file manager which you can find in your control panel, or if your control panel does not have a file manager you can also view and change it via FTP (for example with FileZilla).
Below you can see a screenshot of how to check this:
If you want to change the file permissions, you can do so by right-clicking on the file and then choosing file permissions. See an example below:
A new screen will then open where you can enter the numbers discussed earlier under numeric value (644 is recommended). See below:
If this does not work, also check that the parent folder(s) have the correct permissions.
You do this in the same way as how we just described for a file.
Right-click on the folder, and click on File Permissions, making sure that Numeric Value says 755.
* To access the parent folder, you often need more permissions with the FTP user.
By default, an ftp user is put in the public_html (or http), so in theory these files should not be modified, unless something strange happened or you are working outside the public_html / http folder.
In summary, you should check the following points:
- Check if an index file (index.htm or index.html or index.php) is present, if not, upload it via ftp.
- If an index file is present, check that it has read permission (644), as discussed above.
- In addition to file permissions, check that the parent directory has read and execute permissions (755).
- If these are also correct, then only a .htaccess could block the file and you really do not have access to the file, in this case rename the .htaccess to htaccess without a dot, so that the file is no longer read.
- Check that the parent directory has read access, and that it has the correct owner/group.
If the above solutions still do not work, I recommend contacting us.
Please send an email to support@oxxa.com or call us at 088-7507070