hello,
I'm typing my url as http://www.domainname.com, but it's redirecting to http://domainname.com automatically. And i have problem with this.
Please anyone tell me how to avoid this?
Thanks in advance.
hello,
I'm typing my url as http://www.domainname.com, but it's redirecting to http://domainname.com automatically. And i have problem with this.
Please anyone tell me how to avoid this?
Thanks in advance.
Actually, the www is redundant and deprecated. However, it's your personal preference. So edit your .htaccess file or look for a section in your cPanel for URL redirection and check there.
Use the following code in your .htaccess file and make sure you have mod_rewrite ON.
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]Thanks for your reply.
Is it enough to put only in .htaccess file in the root directory?
ya everything is working.
Thanks
Once you have set the htaccess file, also make sure that you set the non www preference in the Google Webmaster Central tools.
Google Preferred Domain tools helps restrict the flow of Google Juice to non www pages and hence may result in better Google PageRank in the long run.
I tried this but i got this error with www
Socket Error 10049 {Thd 3840} [socket #161C, 0.0.0.0:4175 to :0]
@jitendra.web: Contact your hosting provider / sysadmin. Some hosts have been known to restrict access to .htaccess files.
But first, try performing the changes in a step-by-step manner again.
I can make and edit .htaccess file in public_html/
You must log in to post.