Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change 
notification.

The "RewriteDomainToPath" page has been changed by RichBowen:
http://wiki.apache.org/httpd/RewriteDomainToPath?action=diff&rev1=3&rev2=4

+ Note: The rules described here are intended to go in a .htaccess file. If you 
have access to the main server configuration, the technique described here is 
unnecessary, as you should be using a simple Redirect in a <VirtualHost> to 
accomplish this.
+ 
  We recently needed to move several hundred mail domains from standard http
  to SSL secured HTTP (HTTPS). To do so, we chose one domain and used
  mod_rewrite to redirect to that domain. To make things more complicated, we
@@ -28, +30 @@

  Our rewrite rules look something like this:
  {{{
    RewriteEngine On
-   RewriteCond %{HTTP_HOST} ^webmail\.(.*) [NC,OR]
+   RewriteCond %{HTTP_HOST} ^(web)?mail\.(.*) [NC]
-   RewriteCond %{HTTP_HOST} ^mail\.(.*) [NC]
-   RewriteRule ^(.*) https://new_ssl_host/v/%1 [R=301,L,QSA]
+   RewriteRule ^ https://new_ssl_host/v/%2 [R=301,L,QSA]
  
-   RewriteCond %{HTTP_HOST} ^admin\.(.*) [NC,OR]
-   RewriteCond %{HTTP_HOST} ^mailadmin\.(.*) [NC,OR]
-   RewriteCond %{HTTP_HOST} ^site-admin\.(.*) [NC]
+   RewriteCond %{HTTP_HOST} ^(mail|site-)?admin\.(.*) [NC]
-   RewriteRule ^(.*) https://new_ssl_host/v/%1/admin [R=301,L,QSA]
+   RewriteRule ^ https://new_ssl_host/v/%2/admin [R=301,L,QSA]
  }}}
  
  On the SSL virtual host, we then pick up the hostname with the following

Reply via email to