Skip to main content

Drupal tips and tricks

Multi-site compatible apache rewrite rules

When using multi-site configurations in Drupal 4.7, and you want to use URL rewriting in .htaccess to force 'www.' or non-'www.' subdomain access, the rewrite rules used in the standard .htaccess file may be problematic.


# If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule .* http://www.example.com/ [L,R=301]

#
# If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:

Syndicate content