![]() |
How to redirect www to non www
please help me in redirecting www to non www
|
my site : kretyanews.com
i tried "h t-a c c e s s c o d e" and also other "p l u g i n s" but got no solution |
# Redirect www urls to non-www
RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.yoursite\.com [NC] RewriteRule (.*) http://yoursite.com/$1 [R=301,L] Alternatively you can use : # Redirect www urls to non-www RewriteEngine on RewriteCond %{HTTP_HOST} !^example\.com RewriteRule (.*) http://example.com/$1 [R=301,L] I think it will help you. |
You do so from cpanel of the site.
|
Here the code
# Redirect non-www urls to www RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteRule (.*) http://www.example.com/$1 [R=301,L] |
If you have windows hosting then you can do it from webconfig file.
|
Code to redirect www to non-www:
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC] RewriteRule ^(.*) http://%1/$1 [R=301,NE,L] |
please help me in redirecting www to non www.
|
Hey albert ,
I found the solution for it. :) , Few modifications in DNS settings solved my prob. |
You can do url redirection with this code -
#Force www: RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC] This code will surely helpful for url redirection. |
If you have Google webmaster tool than use it for redirecting your site www to without www. In setting you can see the manny option select proffered domain select your domain name without www and save the changes.
|
All times are GMT -7. The time now is 04:40 PM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.