CodeIgniter Forums
Can't access my code igniter 3 website - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Can't access my code igniter 3 website (/thread-79002.html)



Can't access my code igniter 3 website - Lazarus-CG - 04-06-2021

My website has been working for almost a year and then it suddenly stopped loading. When I go to the link it just keeps loading. I am hosting on a shared server. I found this error on the cpanel:
 client denied by server configuration: /site.com/system/
[i] client denied by server configuration: /site.com/application[/i]
[i][i] client denied by server configuration: /site.com/php.ini[/i][/i]

I can access HTML pages that I put at the root of the website but not PHP ones. 
By renaming the index.php and changing from the build from production to development and vice versa, the website works for a short period and the problem reoccurs. I'm assuming the problem is the .htaccess file and apache. 
Any ideas on how to solve the problem?


RE: Can't access my code igniter 3 website - Muzikant - 04-07-2021

In application/config/config.php file set $config['log_threshold'] = 1;

Make sure, the application/logs directory is writable.

Disable .htaccess file by renaming it to htaccess (remove dot from the beginning).

Try to access pages with index.php in the URL. For example: site.com/index.php/controller/method

If it is working with index.php, then the problem is in .htaccess rules. There is no universal solution for this and you must play with it. Every shared hosting is different.

Rename htaccess file back to .htaccess

If it is not working at all, then look in the log files in application/logs directory for more information. There should be some.


RE: Can't access my code igniter 3 website - Lazarus-CG - 04-08-2021

(04-07-2021, 02:46 AM)Muzikant Wrote: In application/config/config.php file set $config['log_threshold'] = 1;

Make sure, the application/logs directory is writable.

Disable .htaccess file by renaming it to htaccess (remove dot from the beginning).

Try to access pages with index.php in the URL. For example: site.com/index.php/controller/method

If it is working with index.php, then the problem is in .htaccess rules. There is no universal solution for this and you must play with it. Every shared hosting is different.

Rename htaccess file back to .htaccess

If it is not working at all, then look in the log files in application/logs directory for more information. There should be some.

Thanks, I'll play with it.  
This is funny cause it's an intermittent error and it was gone when checked today without any effort from me.  So I'll wait to see if the error returns or I'll try to deal with it preemptively. I'm sure these steps will come in handy.