I found a fantastic explanation of .htaccess control of PHP error logging. I've bookmarked it (and now I've webmarked it via my site!), and you should, too. Invaluable information for developers and tech support pesonnel.
Entries tagged as htaccess
Friday, November 21. 2008
PHP Error Logging in .htaccess
Wednesday, November 19. 2008
Blog Maintenance and the 503 Status
Don wanted a way to block access to his blog while he was fiddling with it. He found information about the 503 code online.
Of course, they want to return different codes for search engines and for users. We figured we wanted to return the same thing for users and search engines; after all "Service Unavailable" is the actual status, regardless of who's visiting. The only exception should be the blog maintainer.
Here's the .htaccess we worked out:
CODE:
RewriteEngine On
RewriteBase /serendipity
# Allow blog maintainer back in
RewriteCond %{REMOTE_HOST} !^your\.IP\.address\.here
# Don't loop forever
RewriteCond %{REQUEST_URI} !^/503\.php
RewriteRule .* 503.php [L]
And here's the 503.php file I like:
CODE:
<?php
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
header('X-Powered-By:');
?><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>Get Off My E-Lawn!</title>
</head><body>
<h1>Get Off My E-Lawn!</h1>
<p>
I'm busy maintaining the site. Please don't step on the grass.
</p><p>
I should be ready for visitors again in under an hour.
</p>
</body></html>
We use a PHP file so that we can set the header, and so we can include a retry period for search engines.
If you're one of the few whose server allows [R=503] in the .htaccess, there's an even easier way outlined in the article details.
Continue reading "Blog Maintenance and the 503 Status" »
(Page 1 of 1, totaling 2 entries)