.htaccess : 500 error
If you add something that the server doesn't understand or support, you will get a 500 error page, aka.. "the server did a boo-boo". Even directives that work perfectly on your test server at home may fail dramatically at your real site. In fact this is a great way to find out if .htaccess files are enabled on your site; create one, put some gibberish in it, and load a page in that folder, wait for the 500 error. if there isn't one, probably they are not enabled.
If they are, we need a way to safely do live-testing without bringing the whole site to a 500 standstill.
Fortunately, in much the same way as we used the
only if PHP is loaded, will this directive have any effect (switch the 4 for a 5 if using php5)
php_value default_charset utf-8
..which placed in your master .htaccess file, that would set the default character encoding of your entire site to utf-8 (a good idea!), at least, anything output by PHP. If the PHP4** module isn't running on the server, the above .htaccess directive will do exactly nothing; Apache just ignores it. As well as proofing us against knocking the server into 500 mode, this also makes our .htaccess directives that wee bit more portable. Of course, if your syntax is messed-up, no amount of if-module-ing is going to prevent a error of some kind, all the more reason to practice this stuff on a local test server.
** note: if you are using php5, you would obviously instead use
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home