I actually do not know why your solution doesn't work but we have been
using these two lines and it works great
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
This has been borrowed from drupal's .htaccess file.
--
Bibek Shrestha
bibekshrestha at gmail dot com
Twitter: http://twitter.com/bibstha
"You mustn't be afraid to dream a little bigger, darling.", Eames to
Arthur, Inception 2010
On Sat, Feb 11, 2012 at 3:43 AM, Chandan Gupta <[email protected]> wrote:
> Hi All,
>
> I wanted to redirect all the non www links of my blog to www links
> i.e
> http://linuxcandy.com should come as www.linuxcandy.com
> for which editing .htaccess file in server helped
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} !^www\.
> RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
>
> But, it directs only the home page and not other links.
> For example if I open a link w/o www like
>
> http://linuxcandy.com/2012/02/how-to-install-wordpress-in-ubuntudebain-system-or-server.html
>
>
> it doesn't take me to
> http://www.linuxcandy.com/2012/02/how-to-install-wordpress-in-ubuntudebain-system-or-server.html
>
> Am I missing something in above code for this to work ? or I need to add
> some more line too ?
>
> Thanks,
> Chandan
>
> --
> FOSS Nepal mailing list: [email protected]
> http://groups.google.com/group/foss-nepal
> To unsubscribe, e-mail: [email protected]
>
> Mailing List Guidelines:
> http://wiki.fossnepal.org/index.php?title=Mailing_List_Guidelines
> Community website: http://www.fossnepal.org/
--
FOSS Nepal mailing list: [email protected]
http://groups.google.com/group/foss-nepal
To unsubscribe, e-mail: [email protected]
Mailing List Guidelines:
http://wiki.fossnepal.org/index.php?title=Mailing_List_Guidelines
Community website: http://www.fossnepal.org/