List your Apache virtual hosts
apache2ctl -t -D DUMP_VHOSTS
apache2ctl -t -D DUMP_VHOSTS
This snippet will rewrite all requests to the page iphone.html when viewed on iPhone or iPod Touch. Requests for .gif and .css files are not rewritten, so you can include stylesheets and images in your iPhone-specific page.
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} .*Mobile.*Safari
RewriteRule !\.(gif|css)$ /iphone.html [L]
Source: http://webdirect.no/mobile/apache-rewrite-rule-for-iphone-users/
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
cd /home/httpd/vhosts/domain.com/conf
php_admin_value open_basedir none
/usr/local/psa/admin/sbin/websrvmng -a -vUseful when closing a site for maintenance:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^xxx.xxx.xxx.xxx$
RewriteRule !\.(gif|css)$ closed.php
(Where xxx.xxx.xxx.xxx is your local IP address.)
Allows requests from the specified IP, but everyone else gets the closed page. Allows requests for .gif and .css files so we can display the website logo on the closed page, and use the stylesheet.