When I entered my main url (with www.), it gets redirected to a url (without www.). What happened to my www.? On some of my blog posts, such as this. When I clicked on my affiliate link, (which I used adtrackz to cloak), the www. also disappears! What happened? Is there a problem with my robots.text or .htaccess? Did I place my robots text in the wrong folder? I put in in the main folder & the /blog folder. Did I mess up the file permissions of my robots text or .htaccess? I would like redirect all the non-www. to www., how do I do that? Please help, thank you so much.
This is a .htaccess issue. To achieve what you want to do, place the following in your .htaccess. RewriteEngine on RewriteCond %{HTTP_HOST} ^yourdomain\.com RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=permanent,L]
it's better to make a 301 redirect with the code which is given above. dont waste your time with robots.txt