On Mon, Sep 28, 2009 at 8:52 PM, tcornett <[email protected]> wrote:
>
> Is it possible to force or redirect an entire site to a specified URL?
>
> For example, http://example.com/ gets redirected to http://www.example.com/
>
> Is this possible? If so, can someone point me in the right direction?
>
Use mod_rewrite for that. It's called canonical hostname. Put this in
the top-level .htaccess:
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://www.example.com/$1 [L,R]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---