Apache
Best Practices
Directives recommended for production systems.
ServerTokens Prod
ServerSignature Off
Tuning for Performance
Here are some helpful links.
See also Web Server Performance
mod_rewrite
Some mod_rewrite examples.
These directives simply enable rewrite and logging
RewriteEngine On
RewriteLogLevel 2
RewriteLog "/var/log/apache2/rewrite_log"
This example redirects any requests for /nagios to the secured (https) site. It is useful to put this inside a <VirtualHost *:80> directive.
RewriteRule ^/nagios.* [https://www.example.com/nagios3/](https://www.example.com/nagios3/) [L,R]
This example redirects any request to containing www.example.com Host: header to the secured (https) site
RewriteCond %{HTTP_HOST} ^www.example.com
RewriteRule ^(.*)$ [https://www.example.com$1](https://www.example.com$1) [L,R]
This example redirects request to a homepage (/) to another page -in this case mediawiki main page
RewriteRule ^/$
http://www.example.com/wiki/index.php/Main_Page [L,R]
This example redirects non-secure requests for /admin to the secure-side
RewriteCond %{HTTPS} !on
RewriteCond ^/admin(.*) https://www.example.com/admin(.*) [L,R]