can somebody help me optimize this .htaccess file, it feels like the website takes a bit longer to open then it should, I must be missing some rewritecond'itions ...
here's the file contents:
AuthUserFile /usr/www/secure/.htpasswd
AuthName "Pre Launch Test Area"
AuthType Basic
RewriteEngine On
Options -Indexes
RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD|TRACE)$
RewriteRule .* - [F]
RewriteBase /
RewriteCond %{REQUEST_URI} ^\/img\/emails\/(.*).gif [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^img/emails/btn_(.*).gif$ /button.php?text=$1 [L,NC,QSA]
RewriteRule help_faq(.*) pages.php?page=help&%{QUERY_STRING} [NC,L]
RewriteRule why_us(.*) pages.php?page=why&%{QUERY_STRING} [NC,L]
RewriteRule about_us(.*) pages.php?page=about_us&%{QUERY_STRING} [NC,L]
RewriteRule bugs(.*) pages.php?page=contact_us&inquiry=bug&%{QUERY_STRING} [NC,L]
RedirectMatch ^/~(.*)$ http://www.domain.com/$1
rewritecond $1 !^admin/
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.domain.com/$1 [R=301,L]
rewritecond %{REQUEST_URI} !^/service/ [NC]
rewritecond %{REQUEST_URI} !^/membersarea/ [NC]
rewritecond %{REQUEST_URI} !^/catalog/ [NC]
rewritecond %{REQUEST_URI} !^/community/ [NC]
Rewritecond %{REQUEST_URI} !^/stream/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9A-Za-z_-]+)(\/?)(index.php)?$ http://www.domain.com/$1/service/search/advanced?%{QUERY_STRING} [L]
RewriteRule ^(.*)-([0-9]+).feed$ rss.php?feed=-1&user_id=$2 [NC,L]
RewriteRule ^(.*)-([0-9]+).show$ zend.php [NC,L]
RewriteRule ^(.*)-([0-9]+).item$ zend.php [NC,L]
RewriteRule ^(.*)-([0-9]+).cat$ zend.php [NC,L]
RewriteRule stream/(.*) mvc.php [NC,L]
RewriteRule service/(.*) zend.php [NC,L]
RewriteRule membersarea/(.*) zend.php [NC,L]
RewriteRule catalog/(.*) zend.php [NC,L]
RewriteRule community/(.*) mvc.php [NC,L]
RewriteRule ^(.*),(.*)$ $2.php?rewrite_params=$1&page_url=$2&%{QUERY_STRING}
RewriteRule ^(.*)-([0-9]+).user$ about_me.php?user_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-([0-9]+).feedback$ reputation.php?user_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-([0-9]+).news$ pages.php?page=news&topic_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-([0-9]+).help$ pages.php?page=help&topic_id=$2&%{QUERY_STRING}
RewriteRule /([0-9A-Za-z]+)(\/?.*)-([0-9]+).user$ about_me.php?user_id=$3&owner_username=$1&%{QUERY_STRING}
RewriteRule /([0-9A-Za-z]+)(\/?.*)-([0-9]+).feedback$ reputation.php?user_id=$3&owner_username=$1&%{QUERY_STRING}
php_flag file_uploads on
php_flag max_execution_time 86400
php_flag max_input_time 86400
php_value upload_max_filesize 100M
php_value post_max_size 100M
<FilesMatch ".(png|jpg|gif|ico|js|css)$">
Header set Cache-Control "max-age=259200"
</FilesMatch>
AddDefaultCharset UTF-8
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/png A2592000
ExpiresByType text/plain A2592000
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_flag ignore_repeated_errors off
php_flag ignore_repeated_source off
php_flag report_memleaks on
php_flag track_errors on
php_value docref_root 0
php_value docref_ext 0
php_value error_log /usr/www/www.domain.com/public_html/phperrors
php_value error_reporting 6135