I would use mod_rewrite and not mod_alias (RedirectMatch) for this
task, and here is a example that will make sure you stay with www.

# Force www.cadechristian.com
RewriteCond %{HTTP_HOST}   !^www\.cadechristian\.com [NC]
RewriteRule ^/(.*)         http://www.cadechristian.com/$1 [L,R=301]

This will always add the proper url with the leading www.

On Jul 31, 4:39 pm, fRAnKEnSTEin <[email protected]> wrote:
> Hi there,
>
> I use this in my .htaccess for redirect URL mysite.cr towww.mysite.cr.
> It redirects fine.
>
> ...
> ...
> ...
> RewriteEngine On
> RewriteCond %{HTTP_HOST} ^mysite.cr [NC]
> RewriteRule ^(.*)$http://www.mysite.cr/$1[L,R=301]
>
> But the first URL(the one that does not has www) stays without www
> even when it redircets properly. What i am trying to do is that no
> matter what URL somebody use(www.mysite.cror mysite.cr), i want the
> final URL always to have www at the beginig.
>
> Any idea?
>
> Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to