301 (permanent) redirect all non-www requests to www.
Apache webserver with mod_rewrite enabled; apache.conf or .htaccess file.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com/? [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^mydomain.com/? [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]
This will redirect requests to all pages to www. domain.
No comments:
Post a Comment