# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	corzblog /.htaccess
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	file types setup..
#
#	for php as regular apache module..
#	(for phpsuexec (aka. cgi) use, set this in a local php.ini file)
#
<ifmodule mod_php4.c>
	php_value default_charset utf-8
</ifmodule>
<ifmodule mod_php5.c>
	php_value default_charset utf-8
</ifmodule>
#
#	on windows servers, you may have to comment out the <ifmodule> lines.
#
#	Then, tell Apache to NOT add its own headers, thanks.
#
AddDefaultCharset off 
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	parse .css files as php..
#
#	essential for corzblog dynamic on-the-fly css creation.
#
#	note: FilesMatch is phpsuexec safe.
#
<FilesMatch "\.(css|style)$">
    SetHandler application/x-httpd-php
</FilesMatch>
#
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	mod_rewrites
#	permalinking, etc..
#
RewriteEngine On
#
#
# wanna see a an .ini? 
RewriteRule \.ini$ http://en.wikipedia.org/wiki/INI_file [r,nc]
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	permalinking rules	[and flat-links].
#
#	you can access corzblog blogs like this..
#
#		http://corz.org/blog/2003-oct
#
#	and individual entries like this..
#	
#		http://corz.org/blog/2005-aug/Abrasive-Mouthwash
#
#	these permalink rewrites rules should work fine from inside *this* folder.
#	corzblog takes care of the tricky bits, and we can enable flat-links, as
#	well as handle the permalinks, with three simple rules. In addition to 
#	the permalinks and flat-links, as a bonus, these..
#
#		http://corz.org/blog/2003-nov
#		http://corz.org/blog/arc/2003-nov
#		http://corz.org/blog/arc/2003-nov.blog
#
#	should all lead to exactly the same page. here's how..
#
#	first, redirect direct hits on the blog archives..
#
rewriterule ^about\.blog /blog/about-blog [R=301,NC,L]
rewriterule ^blogz\.blog /blog/ [R=301,NC,L]
rewriterule ^arc/(.*)\.blog /blog/$1 [R=301,NC,L]
rewriterule ^arc/(.*) /blog/$1 [R=301,NC,L]

#
# note: 'L' to denote the LAST rule 
# so rewriting will begin again at the start, with the new request.
#
# then the main flat-link rewrite rule..
#
rewriterule ^([_a-z0-9]+)-([_a-z0-9-]+)/?(.+)?  index.php?archive=$1-$2&blog=$3 [NC,L]
#
# note no forward slash at the start of the target - we use a relative link.
# that's all there is to it.
#
# but if that doesn't work, try something like this in your ROOT .htaccess..
#
#RewriteEngine on
#RewriteRule ^blog/([_a-z0-9]+)-([_a-z0-9-]+)/?(.+)?  http://mydomain.com/blog/index.php?archive=$1-$2&blog=$3 [nc]
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	or else allow direct access to the raw blogs..
#
#	with this set, if anyone accessed your blog file directly they would at 
#	least see basic html formatting. if your redirect (above) is working, 
#	this will never take effect, so you can leave it in as a fall-back..
#
<FilesMatch "\.(blog|comment)$">
    SetHandler application/x-httpd-php
</FilesMatch>
#
#	below. are rule to prevent EXACTLY this! enable/disable as needed
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
#	prevent direct access to your .blog files..
#
#	note, if you do this, redirects from blog/arc/somename.blog will fail (403)
#
#rewriterule ^(.*)\.blog /blog/ [r,nc]
#
#
# deny direct access to particular files (no rewrite - use a 403)..
# these are files that may be included server-side, or things you like to leave lying around.
#<FilesMatch "\.(blog|comment|nfo|bak)$">
<FilesMatch "\.(comment|nfo)$">
	deny from all
</FilesMatch>
#
#	anything you DON'T add to the above, 
#	will generally redirect the user back to your main blog page
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # #
                                                  #
# # # # # # # # # # # # # # # # # # # # # # # # # #
#
# if you have php5 or greater, there's no need to set the time difference
# preference. instead, set your own local timezone here..
# NOTE: this is now set inside init.php (if applicable)
#<ifmodule mod_php5.c>
#	php_value date.timezone GB
#</ifmodule>
#
#
# NOTE: always leave a spare empty line or two at the bottom of an .htaccess files.
#
#

# catch hits for old cbdemo.. (alter the /blog/ part if you move corzblog!)
rewriterule cbdemo\.php /blog/inc/cbparser-demo.php [R,NC,L]
