Daniel Lo Nigro | 1 Nov 07:53 2011

Re: Simple page redirections

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 <tiit <at> sympatico.ca> 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
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee

_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
Etienne Desautels | 1 Nov 19:56 2011
Picon

Re: Simple page redirections


Thanks for answering.

On 2011-11-01, at 02:53, Daniel Lo Nigro wrote:

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
If I understand correctly, this will not work because the file doesn't exists! So the rule will not catch 'home.htm' that should be redirected to 'index.html' ('home.htm' doesn't exists).

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.

Unfortunately it doesn't work either because it will by applied to all files that don't exists, but in general these requests should be handle by my Django app.

By "bit heavy" did you mean it was causing performance issues, or are you just worried about potential performance impacts?

No, I mean "A bit heavy to write and maintain". If I could do simple list of matches and redirections, it will be more light!

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).

I know I can do this kind of approach with my Django app, but I find it stupid to handle that at the application level when is just a list of matches with redirections. It's a nice job for a web server.

I found a new solution that is a little bit better. I'm using the Full Path Rule, adding one path for each bad URL, and adding a new Regex for each file in the Redirection Handler. This way I only have one Rule. It's mostly a list of matching URL with redirections but I have to copy the bad URL 2 times (in the rule and then in the handler) and in the handler I need to write it as a Regex. I also need to be careful that a Regex will not match another URL in the list.

In the Rule tab:

Full Path

- /home.htm
- /about_us.htm
- ...


And in the Handler tab:

Redirection

- External  |  /home\.htm$  |  index.html
- External  |  /about_us\.htm$  |  about.html
- ...


Etienne

 - Daniel

On Tue, Nov 1, 2011 at 4:53 AM, Etienne Desautels <tiit <at> sympatico.ca> 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
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee


_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
Jedrzej Nowak | 2 Nov 00:49 2011
Picon

Re: Simple page redirections

Does all your "old" urls have .htm on the end ??and you don't have any existing .htm file ??
If yes just use the approach that I suggested with my first answer.

If you have any existing .htm file just add "file exists rule" and place it above that redirection one, set the handler to "static".

01-11-2011 19:56 użytkownik "Etienne Desautels" <tiit <at> sympatico.ca> napisał:

Thanks for answering.

On 2011-11-01, at 02:53, Daniel Lo Nigro wrote:

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
If I understand correctly, this will not work because the file doesn't exists! So the rule will not catch 'home.htm' that should be redirected to 'index.html' ('home.htm' doesn't exists).

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.

Unfortunately it doesn't work either because it will by applied to all files that don't exists, but in general these requests should be handle by my Django app.

By "bit heavy" did you mean it was causing performance issues, or are you just worried about potential performance impacts?

No, I mean "A bit heavy to write and maintain". If I could do simple list of matches and redirections, it will be more light!

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).

I know I can do this kind of approach with my Django app, but I find it stupid to handle that at the application level when is just a list of matches with redirections. It's a nice job for a web server.

I found a new solution that is a little bit better. I'm using the Full Path Rule, adding one path for each bad URL, and adding a new Regex for each file in the Redirection Handler. This way I only have one Rule. It's mostly a list of matching URL with redirections but I have to copy the bad URL 2 times (in the rule and then in the handler) and in the handler I need to write it as a Regex. I also need to be careful that a Regex will not match another URL in the list.

In the Rule tab:

Full Path

- /home.htm
- /about_us.htm
- ...


And in the Handler tab:

Redirection

- External  |  /home\.htm$  |  index.html
- External  |  /about_us\.htm$  |  about.html
- ...


Etienne

 - Daniel

On Tue, Nov 1, 2011 at 4:53 AM, Etienne Desautels <tiit <at> sympatico.ca> 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
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee



_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee

_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
raynix | 6 Nov 03:12 2011
Picon

Hello there. new comer:)

Hello, I am new to Cherokee and like it. Hope I can learn a lot here:)


Regards,

Raymond

_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
Jędrzej Nowak | 6 Nov 03:29 2011
Picon

Re: Hello there. new comer:)

"Welcome" ;-)

--
Kind Regards
Jędrzej Nowak

On Sun, Nov 6, 2011 at 3:12 AM, raynix <raynix <at> gmail.com> wrote:
> Hello, I am new to Cherokee and like it. Hope I can learn a lot here:)
>
>
> Regards,
>
> Raymond
>
> _______________________________________________
> Cherokee mailing list
> Cherokee <at> lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
>
_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
Daniel Lo Nigro | 6 Nov 09:39 2011

Re: Hello there. new comer:)

Welcome! Feel free to ask if you have any questions :)

On Sun, Nov 6, 2011 at 1:12 PM, raynix <raynix <at> gmail.com> wrote:
Hello, I am new to Cherokee and like it. Hope I can learn a lot here:)


Regards,

Raymond

_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee


_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
raynix | 6 Nov 14:05 2011
Picon

My first question: .htaccess -> regex rules

Hello Cherokee fans,


I'm planning to run Joomla! 1.7 on Cherokee 1.2, and I like friendly neat URLs very much. So before I make any attempt to convert .htaccess file of Joomla! to Cherokee regex rules, I would like to ask if anyone has done this already? 

Also the same question with Wordpress 3.2.


Regards,

Raymond
_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
Keith Hoffmann | 6 Nov 19:27 2011
Picon

Re: My first question: .htaccess -> regex rules

Hi Raymond,

Plenty of people have done it. It's relatively easy. Everything you need should already be in the docs:
http://www.cherokee-project.com/doc/cookbook_wordpress.html

On Sun, Nov 6, 2011 at 7:05 AM, raynix <raynix <at> gmail.com> wrote:
Hello Cherokee fans,

I'm planning to run Joomla! 1.7 on Cherokee 1.2, and I like friendly neat URLs very much. So before I make any attempt to convert .htaccess file of Joomla! to Cherokee regex rules, I would like to ask if anyone has done this already? 

Also the same question with Wordpress 3.2.


Regards,

Raymond

_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee


_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee
sherwood | 4 Nov 15:05 2011
Picon

Re: Cherokee 1.2.101 released

On my installation (v. 1.2.98) all works fine, but I have a directory secured
with basic auth. with plain text file and this fails at least whit Cherokee v.
1.2.100. and v. 1.2.101. It's a bug?
John | 9 Nov 21:18 2011

Hi & Segmentation fault

Hello cherokee community!

I have recently started using cherokee and I am a big fan so far, however my first venture into the mailing lists is a support request :(

I am primarily a web developer, with very limited sys admin skills so I used the cherokee docs to set up PHP and cherokee.

Currently cherokee serves static files and one PHP file, this PHP file then queries an external service, it is hammered by AJAX requests. I have the results of this external service stored with memcache for around 30 seconds.  However at peak times it seems that the system slowly grinds to a halt, and 504 errors are shown. The HTML/JavaScript etc are still as fast as ever though, I'm assuming this is because of cherokee's internal cache?

Here is a message in /var/mail/root:

Subject: Segfault in Cherokee

The Cherokee 'panic action' script, /usr/share/cherokee/cherokee-panic,
was called for pid 7649 ().

This means there was a problem with the program, such as a segfault.
However, the executable could not be found for process 7649.
It may have died unexpectedly, or you may not have permission to
debug the process.

Here are a few errors in the cherokee.error file:

Couldn't create FastCGI listen socket on port 127.0.0.1:47990
Cannot bind/listen socket - [98] Address already in use.
Couldn't create FastCGI listen socket on port 127.0.0.1:47990
Cannot bind/listen socket - [98] Address already in use.
Couldn't create FastCGI listen socket on port 127.0.0.1:47990
[09/11/2011 21:40:48.476] (error) fdpoll-epoll.c:140 - epoll_ctl: ep_fd 6, fd 351: 'No such file or directory'

I have tried googling around and not really found anything that helps.

I am running Debian 6 and Cherokee 1.0.8 with PHP 5.3.8 from dotdeb.

Would anyone be able to help out with this issue, is this a misconfiguration on my part or just the VPS not being powerful enough for the amount of traffic that it gets? (I disabled RRD stats as I thought that this would be a factor so I cannot give any real figures to hits etc, however I know that the bandwidth usage has been around 20Gb+ for 1 and a half weeks worth of usage)

Thanks in advance.

John.
_______________________________________________
Cherokee mailing list
Cherokee <at> lists.octality.com
http://lists.octality.com/listinfo/cherokee

Gmane