One simple way I can think of, I didn't test this though:

   - Create a final "File Exists" behaviour using "List & Send" handler to
   serve all your pages
   - Change the default behaviour to use the "Redirection" handler"
   - Add all your pages as regular expressions (eg. /home\.html) to this
   behaviour

Another option is to create a "Not file exists" rule (by creating a File
Exists rule and then clicking the "NOT" button). But I assume one of these
is what you're already doing. By "bit heavy" did you mean it was causing
performance issues, or are you just worried about potential performance
impacts?

Another option is to create a script (for example, a PHP script) and
redirect all 404s to it, and have the script try to work out where to
redirect to. This would essentially move all the redirect logic into a
single script, and might end up more efficient than using a large number of
regular expressions (as you can do simple string matching in your script).
This can easily be done by using the "custom redirections" option on the
"error handler" tab and adding an internal 404 redirect to /404.php (or
whatever you call the script).

 - Daniel

On Tue, Nov 1, 2011 at 4:53 AM, Etienne Desautels <[email protected]> wrote:

>
> Hi,
>
> How I'm supposed to do simple page redirections in Cherokee.
>
> For example if I have some old pages/URL that no longer exits and I want
> the redirect theses URL to other existing URL like:
>
> /home.htm -> /index.html
> /about_us.htm -> about.html
> ...
>
> I have like 20 or more redirections like this to do. The only way I found
> right now is to create a new Regex Rule for each URL with a redirection
> Regex Handler. But I found this solution a bit heavy.
>
> Thanks
>
> Etienne
> _______________________________________________
> Cherokee mailing list
> [email protected]
> http://lists.octality.com/listinfo/cherokee
>
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee

Reply via email to