7

I'm pretty new to cherokee, it's great and pretty straight forward except URL Rewrites. Is there a straight forward guide to it? Let me know.

Also how would I port this:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Thanks

0xdeadbeef
  • 397
  • 6
  • 13

2 Answers2

8

Assuming that you are using the default server and you have already set the PHP FastCGI handler:

  1. Go to Virtual Servers.
  2. Select your server.
  3. Click on "Behavior" tab
  4. Edit the "Default" rule.
  5. Change its "Handler" to "Redirection"
  6. The interface would change. Now fill the fields:
    • Type: Internal = server side, External = client side
    • Regular expression: ^(.*)$
    • Substitution: /index.php?q=$1
  7. All your other URL rewrites should be added there.

That should work for your rule.

Notes: Behavior rules orders matters so.. place your PHP handler on top and set it to be non-final. For static content like CSS or images you should create new rules ( type: directory, handler: static content ).

I hope this helps you. Bye!

p.d: If you need them, I can make some screens.

toqueteos
  • 196
  • 4
  • The apache configuration says that file and directory do not exist. To do this in cherokee you could use a file not exists matching rule with the redirect. – Wienczny Jul 13 '10 at 20:10
1

You just need to stack several handlers for the virtual host.

First you need the Static Content or the List & Send handler to mimic the RewriteCond statements followed by a Redirection handler to mimic the actual RewriteRule statement.

There could be problems with the QSA flag, though...

joschi
  • 20,747
  • 3
  • 46
  • 50
  • I didn't quite get it, is there a straight forward guide. Pardon my ignorance. I tried reading, i thought the web admin would make things easy. I'm just trying to make urls readable. – 0xdeadbeef Mar 14 '10 at 16:22