Hello DPs, I have just buy a new domain and i need little help for that. whenever im trying to go to my domain name by typing it in address bar like "xyz.com" then after full page load it looks same... like "xyz.com" i need help for it to redirect like this whenever i or someone else type in address like "xyz.com" then it should automatically assign the www.xyz.com after full page load.. how can i do that? do i need to make changes to DNS? expert please reply... Regards, YOGI.
Put this in your .htaccess: Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] Replace domain.com and www.domain.com, you must have mod-rewrite enabled. Voila!
Who are you buying the domain names from? I purchase through godaddy and they are really easy to set up forwarding/redirecting and masking If you contact the company that you are purchasing from, they should be able to advise you on that If not, you should probably purchase your domain names from another company. Again, I use godaddy and really like them I don't really know of any other companies because I have only used them
Thanks for this help... @mreb1010 I had too purchase it from Godaddy.. can u tell me which steps i have to use to do that?
Don't listen to him, I think he misunderstood the question or I think he's referring to other redirections. Rep if I helped you
Yeah the .htaccess trick is exactly what you want, that way Google will apply power on one page only, instead of splitting it between http://doma.. and http://www.doma...
By the way, I may be wrong but I think the third line had a little typo. Try this if it don't work: Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
are you using cpanel as the control? in which case u can easily do it from cpanel. Its the same as changing .htaccess only it does it for you! Go do rewrites put the domain name and say wildcard and make the redirect url to have the www
I use this trick on every site of mine except wordpress blog because wordpress has a similar system built-in. here are the code for .htaccess :
hey.. i just found solution for it from http://www.searchenginepromotionhelp.com/m/articles/search-engine-problems/domain-redirection.php I have just tried it on my WEBSITE and it work like a charm... THanks for the help guys...
yes... i know that method too... but if i use it then what about BING and yahoo? they will consider my site have two url's!!!
with the code that I given you do not need to write down every domain to each of your site. just make one .htaccess and insert that codes I given and you can copy those files to any site you like.