Hi all, My website( I can't revel the site address, lets us say XYZ.COM, doesn't show up without typing "www" in the address bar? That is: if i type: xyz.com or http://xyz.com it doesn't show only when i type: http://www.xyz.com or www.xyz.com the website is displayed. Any suggestion or did anyone had similar problem? care to enlighten me in this regard? Thanks for your help in advance! puntertips
It is running something like drupal, wordpress, joomla? If so you can change the settings quite easily. If not you need to stick something in your htaccess to get it to redirect correctly. If I recall correctly something like this would work in your htaccess: # force www IN URL RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteRule ^(/.*)$ http://www.example.com/$1 [R=301,L] # END force www IN URL
your hosting sever OS is all dose matter in this problem above code is only work in Linux base server... so be clear with server OS..
Yes u need to do a 301 redirect for example add this to the second line of your .htaccess file RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite.com$ RewriteRule ^/?$ "http\:\/\/www\.yoursite\.com" [R=301,L] replace yoursite with your own site name and that should do. If you don't have a .htaccess file in your root directory then you need to make one. Cheers