<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule	^(download)/([a-zA-Z0-9]*)\/?$											/include/download_prepare.php?type=$1&token=$2 [L]
	RewriteRule	^(download)/([a-zA-Z0-9]*)\/get$										/include/download_prepare.php?type=$1&token=$2&get=1 [L]
	RewriteRule	^(mail-export)/([a-zA-Z0-9]*)\/?$										/include/download_anonymous.php?type=$1&token=$2 [L]
	RewriteRule	^(mail-export)/([a-zA-Z0-9]*)\/get$										/include/download_anonymous.php?type=$1&token=$2&get=1 [L]
	RewriteRule	^atom\/(cooliris)+\/?([0-9]*)\/?$										/cooliris.php?item_id=$2 [L]
	RewriteRule	^include\/directprev_([0-9]+)_([0-9]+)\.mp4$							/include/directprev.php?bas=$1&rec=$2 [L]
	RewriteRule	^atom/([a-zA-Z0-9]*)$													/atomfeed.php?inf=$1 [L]
	RewriteRule	^rss/([a-zA-Z0-9]*)$													/atomfeed.php?inf=$1 [L]
	RewriteRule	^register-confirm=([a-zA-Z0-9]+)$										/login/register-confirm.php?code=$1 [L]
	RewriteRule ^document\/?([0-9]+)?\/?([0-9]+)?\/?([a-zA-Z0-9]+)?\/?(overview)?\/?$	/include/directprev.php?bas=$1&rec=$2&sha=$3&view=$4	[L]
	RewriteRule ^document\/([0-9]+)\/([0-9]+)\/([a-zA-Z0-9]+)\/view\/?$					/include/overview.php?bas=$1&rec=$2&sha=$3	[L]
	RewriteRule ^(minilogos|stamp|watermark|presentation)\/?([0-9]+)?\/?$				/include/ajaxgetback.php?action=images&type=$1&base_id=$2	[L]
	RewriteRule ^(status|print)\/?([0-9a-zA-Z-_\.]+)?\/?$								/include/ajaxgetback.php?action=images&type=$1&name=$2	[L]

	RewriteRule	^login/(client|prod|admin|report|thesaurus|upload|lightbox)\/?$			/login/index.php?app=$1 [L]
	RewriteRule ^include/minify/([a-z]=.*)  											/include/minify/index.php?$1  [L,NE]
	RewriteRule ^setup/index.php$ 														/setup/installer.php
	RewriteRule	^lightbox/(validate|compare)\/?([0-9]+)?\/?$							/lightbox/validator.php?ssel_id=$2 [L]


	RewriteRule ^admin/test-rewrite$ admin/adminFeedback.php?action=APACHE&test=success [L]
	<IfModule mod_xsendfile.c>
		RewriteRule ^admin/test-xsendfile$ admin/adminFeedback.php?action=APACHE&test=success [L]
	</IfModule>
	<IfModule mod_auth_token.c>
		RewriteRule ^admin/test-authtoken$ admin/adminFeedback.php?action=APACHE&test=success [L]
	</IfModule>
	<IfModule mod_h264_streaming.c>
		RewriteRule ^admin/test-h264$ admin/adminFeedback.php?action=APACHE&test=success [L]
	</IfModule>
	
	RewriteRule ^admin/test-rewrite$ admin/adminFeedback.php?action=APACHE&test=fail [L]
	RewriteRule ^admin/test-xsendfile$ admin/adminFeedback.php?action=APACHE&test=fail [L]
	RewriteRule ^admin/test-authtoken$ admin/adminFeedback.php?action=APACHE&test=fail [L]
	RewriteRule ^admin/test-h264$ admin/adminFeedback.php?action=APACHE&est=fail [L]
</IfModule>


<Files .htaccess>
	order allow,deny
	deny from all
</Files>

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

<ifModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
</ifModule>

ErrorDocument 204 /include/error.php
ErrorDocument 400 /include/error.php
ErrorDocument 403 /include/error.php
ErrorDocument 404 /include/error.php
ErrorDocument 500 /include/error.php

<IfModule mod_php5.c>
  php_flag 	short_open_tag		off
  php_flag	asp_tags			off
  php_flag	magic_quotes_gpc	off
  php_flag	register_globals	off
  php_value max_execution_time	"30"
  php_value output_buffering	"4096"
</IfModule>
