dynamic rule

Discussion in 'Apache' started by bokehman, Feb 9, 2006.

  1. #1
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*) http://www.%{HTTP_HOST}$1 [L,R=301]
    Code (markup):
    Is it possible to do the inverse of this i.e. if the www is present, to remove it but I don't want a static rule. I want it dynamic so it can be applied to all domains, i.e. in a dynamic virtual host.
     
    bokehman, Feb 9, 2006 IP