SEARCH

Force www or without www in domain name with Drupal
admin
30.09.2013

If you want to force a URL to be with www in Drupal add this in .htaccess:

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

If you want to force a URL to be without www in Drupal add this in .htaccess:

RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

or uncomment the rules that are already in your .htaccess that comes with your Drupal installation :)

This is relevant for …

Drupal, Apache

Post a comment