Or you can use this if you are using lighttpd

# from any www.host (with www.) to the host (without www.)
$HTTP["host"] =~ "^www\.(.*)" {
  url.redirect = ( "^/(.*)" => "http://%1/$1"; )
}

another good place to look is 
http://no-www.org/

Martin



On Thu, 2007-04-26 at 14:46 +0100, Kevin Ansfield wrote:
> Hi Suzanne,
> 
> This is something that you could be handling quite easily in your web
> server rather than in your application. In Apache for example, adding
> the following right after the "RewriteEngine On" line would achieve
> what you want: 
> 
> # Redirect non-mydomain.co.uk domains
> RewriteCond %{HTTP_HOST} .
> RewriteCond %{HTTP_HOST} !^mydomain\.co\.uk
> RewriteRule (.*) http://mydomain.co.uk/$1 [R=301,L]
> 
> After this you should have the default Rails/Radiant content and
> everything will get picked up correctly as the above code is only
> processed when the domain does not match your wanted domain and halts
> processing after the redirect when it doesn't. 
> 
> Best Regards,
> Kevin Ansfield
> 
> 
> 
> On 4/26/07, Suzanne Holland <[EMAIL PROTECTED]> wrote:
>         > My current issue is that the following URL's all serve the
>         same page: 
>         >
>         > http://example.com
>         > http://www.example.com
>         > http://anythingelseyoucaretotry.example.com
>         
>         > I'm using Media Temple.
>         
>         
>         
>         Likewise, on both counts. (Although I feel this is a Rails/MT
>         issue
>         rather than a Radiant one).
>         
>         I'm not convinced editing the .htaccess file is even the way
>         to go in 
>         this situation; given the 'automatically generated' MT code is
>         already
>         rewriting the URL through a proxy.
>         
>         Please excuse my ignorance, I'm new to both RoR & Radiant, but
>         a one
>         word yes/no answer from someone with knowledge of the platform
>         would be 
>         extremely helpful.
>         
>         Anyone?
>         
>         
>         --
>         Posted via http://www.ruby-forum.com/.
>         _______________________________________________
>         Radiant mailing list
>         Post:   [email protected]
>         Search: http://radiantcms.org/mailing-list/search/
>         Site:   http://lists.radiantcms.org/mailman/listinfo/radiant
> 
> _______________________________________________
> Radiant mailing list
> Post:   [email protected]
> Search: http://radiantcms.org/mailing-list/search/
> Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to