hey all- Installing a few new WP blogs today, and had a question about how to redirect everything to a www. address. In other words, I want www.sample.com not sample.com... Im sure this is easy, but Im lost! Thanks in advance.
mikemdg - sounds good! So all I have to do is add the "www" where it says WordPress Address and Blog Address? That will make sure everything points to the "www" for SEO purposes? Thanks in advance!
yup. i just did it. WP Dashboard -> Options -> Wordpress URL Because you can have a subdomain like forums.sample.com and blog.sample.com In case you have blog.sample.com you must create a subdomain first. Good luck with your blog. Btw. I hope you enjoy mine... www.CanCanBlog.com - its about innovative promotion techniques
A 301 redirect by adding the following code to your htaccess should solve the problem. RewriteEngine on RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] To see whether the code did work, test it by typing the non www version, it should resolve to the www version.
liverpoolfan - Thanks for the code. Do I need to do this in addition to changing it in the Wordpress dashboard? Or can I just make teh WP change and forget adding the code to htaccess?
better implement what gr8liverpoolfan said, in this way you will not be messing up with WP code. place that on .htaccess before that WP generated .htaccess code