403 error on entire site
-
Hi,
I recently deleted my public html folder by mistake. So I restored a backup qwith softaculous, but now the entire site gets a 403 forbidden error. What could have happened and what can I do about it?
https://www.pmb-fibreglass.co.za
Alastair
-
Hello, alastair, & welcome to the WordPress support forum.
The message I actually get is “You are not permitted to access / on this server. So I’m wondering if the files you restored went to the root as opposed to public_html.
Here’s another thing you could try.
Your database is actually what contains your posts, pages, etc. So, you could actually reinstall WordPress from your control panel, filling in the database name, username, password, etc., that you used for your old database. Those details also reside in your wp-config.php file.
Please let me know if I’m not clear regarding any of this.
Hi Jackie,
Thnaks fpor your time in helping me with this.
Taking a closer inspection I see that my index.php file cotnains:
<?php
// Silence is golden.I did a google and it appears this is a hack?
Alastair
Actually, Alastair, that sort of thing often appears farther down in the directory tree, i.e., wp-content, to prevent browsing of folder structures. I’m still thinking your restored backup might not have been put in the right place. But here again–you can easily download WordPress, as well as your plugins & themes. You just have to link the installation to the correct database, as that is what contains your content. You do that by means of your wp-config.php file.
Hi Jackie,
The Files do appear to be in Public_html folder.
I tried reinstalling wordpress (I made sure the database has the same details from wp-config) – the website is still “You don’t have permission to access”.
What next?
Alastair
Hi Alastair,
Please make sure you have following permissions on WordPress instillation.
Public_html folder ..750
Other sub-folders …755
All files ………..644You can set permissions yourself from cPanel. If you are not sure how to set permissions, you can contact your web host for the same.
Thanks,
I am now getting a “Internal Server Error” on the website.
Hi Alastair,
500 Internal server error is generic error not WordPress specific.In WordPress is often caused by plugin and/or theme functions. Other possible causes of internal server error in WordPress are corrupted .htaccess file and PHP memory limit.
You can try following suggestions:
1) Rename main .htaccess file to something like .htaccess_old. To rename the .htaccess file, you will need to login to your site using the FTP. Once you are in, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.
Once you have renamed the .htaccess file, try loading your site to see if this solved the problem. If it did, Go to Settings ? Permalinks and click the save button. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a 404.
2) Deactivate all WordPress plugins at once. If disabling all plugins fixed the error, then you know it is one of the plugins that is causing the error. Simply go through and reactivate one plugin at a time until you find the one that caused the issue. Get rid of that plugin, and report the error to the plugin author.
3) Contact your hosting provider. By looking at the server logs, they should be able to get to the bottom of things.
Thanks,
Alastair, to what folder have you installed WordPress?
Your index.php file *in the folder where you installed WordPress* should look like:
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . ‘/wp-blog-header.php’ );
If you’ve installed WordPress to something other than the root folder, the index.php file *in the root folder* will look just a bit different on the last line & contain:
require( dirname( __FILE__ ) . ‘/wordpressfolder/wp-blog-header.php’ );If you modified .htaccess or the wp-config.php, then the possibility exists that a single punctuation mark out of place can cause a 500 internal server error.
1 of the most helpful things I find in diagnosing problems like this is error logs. If you use CPanel as your control panel, these are generally provided. Telling us their contents might help us get to the bottom of the matter sooner.
If you’ve deleted your public_html directory on a cPanel server you cannot simply re-add it and expect it to work.
You will need to change ownership of the folder via the command line, meaning that you’ll need to contact your hosting company and get them to restore this for you.
Yes Jackie the installation is definitely in Public_html.
I see that if I change the permissions on the Public-html folder to 251 the website works, but at 250 it doesn’t. So I have asked the hosting provider to look into it ….. as juslooken suggested.
Oops, that’s a 751 file permission.
Hi Alastair
It’s more of an ownership issue than a permissions issue (which you can change with your ftp client). Basically the ownership of the public_html folder should be your username and the group permission should be ‘nobody’, which unfortunately you cannot change through FTP.
As you’ve mentioned, you’ve contacted your hosting provider so hopefully they’ll be able to fix everything up for you soon.
OK so I have made some progress. The Public-html ownership has been sorted out. Now, when I try to restore a softaculous backup I get this message:
The following errors were found :
Could not connect to the database Access denied for user ‘dkzhzsks_wp819’@’localhost’ (using password: YES)
Is there any soliution to this?
Alastair
Fortunately I kept a copy of the original config file……I found th right password in there.
Everything OK now.
Thankyou to Jackie McBride, Juslooken and Accuwebhosting for your time and effort in helping me sort this. Much Appreciated!!
Kind regards
Alastair
Topic is resolved
- The topic ‘403 error on entire site’ is closed to new replies.