Today we are concerned with the Apache web server and doing SEO / SSL friendly 301 redirects for host.com to www.host.com.
If you are just running host.com and not using any named virtual hosts you can do:
ServerName www.host.com
RewriteEngine on
RewriteRule ^/(.*) http://www.host.com/$1 [L,R=301]
If you are running named virtual hosts you can then add the directives below to your virtual hosts.
<VirtualHost *:80>
ServerName somehost.com
Redirect 301 / http://host.com
</VirtualHost>
No comments:
Post a Comment