Force site URL using www

Force site URL using www

Postby kabon » Mon Sep 20, 2010 5:17 am

I set my site address http://www.mysiteblabla.net on site configuration, but when i access without www, my site url not redirect to http://www.mysiteblabla.net.

Tofix this i add this code to my .httaccess

Pasted the following code under "RewriteEngine On" Section

RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
kabon

 
Posts: 5
Joined: Fri Sep 17, 2010 6:03 pm

Re: Force site URL using www

Postby viralads » Mon Mar 14, 2011 9:47 am

Worked for me, thanks - though I am on a dedicated server and prefer to modify the http conf file.
viralads

 
Posts: 1
Joined: Mon Mar 14, 2011 9:43 am

Re: Force site URL using www

Postby soulgeek » Tue Mar 15, 2011 3:27 am

viralads wrote:Worked for me, thanks - though I am on a dedicated server and prefer to modify the http conf file.



hi,

Earlier i used this code in my .htaccess, all works but, when u click on a product page and even the cart, it seems ot have messed up because of this redirect.

so after implementing this, better double check all the functionality of ur site.

If all works, do let us knwo here, so i can rectify any error if i did somethign wrong. I am on a VPS too.

Cheers
soulgeek

 
Posts: 35
Joined: Tue Feb 15, 2011 4:45 am


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest

cron