Hi everyone,

I installed Cherokee on my server at the weekend (Apache is gobblng up
all my memory), and I have to say I am blown away - what a great
project!

I have one question though regarding domain name canonicalisation and
redirections...

Despite reading the documentation and searching the mailing list, I
have not seen an efficient/clean way of handling of configuring a
primary domain for a virtual host, and having other combinations 301
redirect to it.

In apache, I would use the following to set the possible domains for a
virtual host, and make all of them 301 redirect to the primary domain:

# Website Server Name/Aliases
ServerName  mysite.com
ServerAlias www.mysite.com
ServerAlias anothersite.co.uk
ServerAlias www.anothersite.co.uk

# Redirect To Primary Domain - needs mod rewrite enabled
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} !^www\.mysite\.com$
  RewriteRule ^/(.*) http://www.mysite.com/$1 [R=301,L]
</IfModule>

This is a clean way of setting multiple domain names for a virtual
host, and have them all automatically redirect to the primary domain -
which can be very important for Search Engine Optimisation (SEO) -
providing one unique URL for each page of content. I can add/remove
extra aliases at any time, and know that they will automatically be
redirected to the correct site.


All the advice I have seen for handling domain redirections in
Cherokee is to configure an extra virtual host. This doesn't seem very
clean to me (maintaining two different virtual host configurations for
each site), and if you are hosting ~20 websites, it soon all gets very
cluttered.


Is there something I am missing, where I can implement this
configuration all in one virtual host? If there is not, then I'd like
to request this as a feature :)


Thanks very much,


Matt
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to