A
A
andreyqin2014-01-18 11:31:34
htaccess
andreyqin, 2014-01-18 11:31:34

Setting up .htaccess before hosting a site on the Internet

There is a simple website (product catalog), I am interested in competent .htaccess settings before placing the site on the Internet. Main questions:
1) Do I need to disable error output (php_flag display_errors off)? Is it better to do it in .htaccess or in some php file?
2) Access to which folders should be closed? The folder structure is simple - css, fonts, images, js, inc, templates.
3) What other settings are desirable?
And an additional question: is it worth turning off error output in this way:

ini_set('display_errors', 'Off');
error_reporting(0);

And where is the best place to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egor_nullptr, 2014-01-18
@egor_nullptr

I recommend the following settings in php.ini:

error_reporting = E_ALL
display_errors = Off
display_startup_errors = Off
log_errors = On
error_log = "<path_to_error_log_file>"

Close access to the inc and templates folders.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question