Hello folks I am using Centos,Apache server to hosting my website. Can somebody guide me step by step how to remove www in the search field? Please check attachment.
Hello, Try adding the following code to an .htaccess file found in your sites root folder, replacing yourdomain with your own of course: RewriteEngine On RewriteRule ^(.*)$ http://www.yourdomain.com [NC] RewriteCond %{HTTP_HOST} ^yourdomain.com/$1 [L,R=301] Code (markup): Regards, Chris
It is simple, Login to cpanel and edit .htaccess file (add the following code) to make 301 redirections. RewriteEngine On RewriteRule ^(.*)$ http://www.yourdomain.com [NC] RewriteCond %{HTTP_HOST} ^yourdomain.com/$1 [L,R=301] Code (markup):
Hello Chris I got error when i make changes with code you have provide,and i have change to my domain name too. Please check attachment. Regards
Ok if that code not working for you. Try this one RewriteEngine on RewriteCond %{HTTP_HOST} ^www\. RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] Code (markup): Replace the example(.)com with your domain name. Don't forget to save the .htaccess file in the public.html folder and update it. Once you updated the .htaccess file, open the website in incognito mode or in a different browser (because of caching).
What can i say man,that i just love you Now is working perfectly. Now can you tell me from your view and from view of word of mouth forsearch engines. Did this what we done is better for search engines and why? I was heard that when in domain name is not www then my website will be ranked better example at Google. Is that true and why? Thanks again my friend for helping me
My pleasure! No, it's a myth. If you have www or not, it has nothing to do with your ranking, even Google itself using a www version. The thing that matters for ranking is to redirect the website only to one domain. For us, both versions of the domain name (www or non-www) are the same because the domain name is what we select to represent our business or brand. If you do not make 301 redirections to redirect your website on a single version (either www or non-www) the search engines consider your domain name as a different version of your website and that affects your rankings. Finally, it is up to you what version you like and wants to use but use only one otherwise it will affect your rankings.