If someone enter domain name as sample.com its shows as http://sample.com why that is not redirect to http://www.sample.com on my site?
You need to create an htaccess file and enter the following. It will redirect traffic from yourdomain.com to www.yourdomain.com. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301] </IfModule> Code (markup): There's lots of info on this on the Web. Search Google for URL rewrite or URL redirection with htaccess...
could you please tell me how i can create and put that code with .htaccess file. i really dont know anything about .htaccess file even dont know how that is working i just know that is a file only
Now i know how i can create htaccess file and where to put code but after creating and putting that code in htaccess file now that domain is not opening, after entering url in browser that domain is not opening, could you please tell me what's problem there?
i had tried all but im failed to redirect, if i redirect to www with cpanel redirection option that is always failed. check after doing that with cpanel redirection and htaccess file now site is not opening www.smsdad.com
May i ask what did u do to solve your problem? Im having similar issues with my subdomain.. www.web.blog-gurus.info used to show as error page.. but http://web.blog-gurus.info works perfectly fine.. i needed to do a redirect from non www to www format so ..i tried to tweak the dns zones, but seems like i didn't do it quite right. www.web.blog-gurus.info is showing the same like my other domain.. www.sari-sari.org Would greatly appreciate if any one here could help me..
i've contacted with my hosting company, they give me bit diffrent code after putting that code my problem solved, i guess every hosting company have some kinda diffrent code im not sure, try to contact with your hosting company.