Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer
    
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

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

share|improve this answer
    
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. –  saint Mar 14 '10 at 16:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.