Home » Odeon Blogs » Stefan Talpalaru, CTO »

www subdomain redirect with cherokee

www subdomain redirect with cherokee

If you are sensible enough to do a Class B setup as defined in http://no-www.org/faq.php and redirect www.domain.com to domain.com, here's a set of instructions to help you achieve it with cherokee:

- create a new Virtual Server using the web interface. By default it will be placed on top, having the highest precedence. You can use the same root path as your main virtual server, it doesn't matter. Give it a suggestive nickname like "www".

- edit "www" and in the Host Match tab change the matching method to Wildcards. Add the hostname www.domain.com in there.

- go to the Behavior tab and delete all the rules but the default one

- edit the default rule and change the handler to Redirection. Make it external and use a regex like ^/(.*)$ for the matches and a substitution like http://domain.com/$1 

That's it. Now save. A graceful restart will be performed and you can test your new setup.


Category: cherokee



Leave a Comment :

(required)


(required)




(required)




(required)






Leave a Comment


Page generated in: 0.15s