Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   How to redirect www to non www (http://siteownersforums.com/showthread.php?t=151705)

kretyanews 01-30-2015 06:11 AM

How to redirect www to non www
 
please help me in redirecting www to non www

kretyanews 01-30-2015 06:14 AM

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

RobbieLima 02-06-2015 03:35 AM

# 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.

kathyrose 02-11-2015 04:31 AM

You do so from cpanel of the site.

nmsleep 02-11-2015 04:55 AM

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]

suhanarai 02-12-2015 04:34 AM

If you have windows hosting then you can do it from webconfig file.

marclewis 03-13-2015 10:28 PM

Code to redirect www to non-www:
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*) http://%1/$1 [R=301,NE,L]

albert7823 03-14-2015 09:50 AM

please help me in redirecting www to non www.

kretyanews 03-15-2015 10:59 AM

Hey albert ,

I found the solution for it. :) , Few modifications in DNS settings solved my prob.

shanewatson11 05-07-2015 02:04 AM

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.

MagentoSite 05-14-2015 02:12 AM

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.