I have a site, and am deciding whether to have www in the domain or not. I understand that I will add the below code to my .htaccess file (typically the one inside public_html). What I don't know is which I should choose and why. If anyone could provide advice I would be grateful as I do not program php or anything so have a low knowledge base. # Never use www in the domain # Replace 'example.com' with your domain name RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(([a-z0-9_]+\.)?example\.com)$ [NC] RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] Always use www in the domain # Replace 'example.com' with your domain name RewriteEngine on RewriteCond %{HTTP_HOST} ^([a-z.]+)?example\.com$ [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .? http://www.%1example.com%{REQUEST_URI} [R=301,L]
Wrong forum. (SEO is what you need) - Anyway, it doesn't matter at all, personal preference. Google doesn't care one way or the other. Fact is, most sites put www in it, so it's probably best just to follow that convention.
Historically "www" meant world wide web, domains having that meant they were accessible for the public by the web. While you could have a completly different domain like login.example.com which is not meant for accessing via port 80 for the www , but maby telnet login or something completly different. Hostnames dont just exist for the web. There meant to just map to a IP for easier referencing. But It doesn't really matter anymore now does it. Those things are just historical blips that have lost their meaning. But most people are still following the old convention of using 'www'. But its not necessary. Use whatever you want.
I like www. because it's nicer if you want to have sub domains later on, like blog. forums. etc. But it's a matter of personal preference and which ever you choose, stick with it...
If you have subdomains don't use WWW however if you have folder type urls use the WWW extension. Also don't forget to redirect all non WWW to WWW type urls if you choose this round or vice-versa.
Sorry about getting the wrong forum i thought this was a code issue. "If you have subdomains don't use WWW however if you have folder type urls use the WWW extension. Also don't forget to redirect all non WWW to WWW type urls if you choose this round or vice-versa." Does Wordpress automatically do this, or is it a hosting issue? And if it is not automated, how does one do it? Thanks!
Well there are 3 ways to redirect. The meta, a php header redirect or the .htaccess file. You should use the .htaccess redirect because it it in heritable by folders inside it and you can use regex to match file names and folder names also. For subdomain WWW to NON WWW use the following code: Replace example with your site. You should always use permanent (301) redirects to make sure there are no duplicate content issues.
Well it depends if the www looks nice with the domain. Something like http://www.apple.com/ <-- Good http://apple.com/ <- Bad http://php.net/ <-- Good http://www.php.net/ <-- Bad Just my preferences.
It took me an hour with the excellent Hostgator support to define all the steps, but I have done it now. For anyone trying to do this... 1 Go to file manager 2 Select Web Root (public_html/www) to open 3 Click on show hidden files 4 Click on the folder icon next to "public_html" 5 Click "Create New File" 6 In the empty text box, write .htaccess 7 Connect to FTP 8 Make sure show hidden files is selected in FTP 9 Open .htaccess file in notepad 10 In Worpress ensure that WordPress address (URL) includes the WWW (see settings-General) 11 Enter code below "<Files .htaccess> order allow,deny deny from all </Files> # BEGIN WordPress # END WordPress #RewriteEngine On #RewriteCond %{HTTP_HOST} ^DOMAIN.com [NC] #RewriteRule ^(.*)$ http://www.DOMAIN.com/$1 [L,R=301]"
once you have completed it per the above is there no need to change it google's webmaster tools? http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=44231 when i tried to do it, it said that i had to verify the non WWW version of the site, but since I have already verified the WWW version this seems odd to me and I dont know what i am supposed to do/verify