I'm currently creating a new application and I know it will only be used on cherokee webserver. I want to create rewrite rules so that all urls look nicer.
I read the cookbook and it could use more examples. Based on the questions I have seen so far I think my below example could be useful for a lot of people needing to drop there .htaccess files and make the switch to cherokee. #My personal needs domain url: http(s)://domainname.com (could be http or https) requirements: do page redirection but make sure to not break, basic file serving (images/css/javascript/etc.) -------------------------- Option 1) remove all page extensions for example: Request: http://domainname.com/user => http://domainname.com/user.php Request: http://domainname.com/project => http://domainname.com/project.php user still needs to be able to use Request: http://domainname.com => http://domainname.com/index.php Request: http://domainname.com/ => http://domainname.com/index.php Request: http://domainname.com/index => http://domainname.com/index.php if a url is build up in the following way Request: http://domainname.com/user/create => http://domainname.com/user.php/create [with path info '/create'] Request: http://domainname.com/project/delete/145786 => http://domainname.com/project.php/delete/145786 [with path info '/delete/145786'] Request: http://domainname.com/project/nice/long/patch/info/string => http://domainname.com/project.php/nice/long/patch/info/string [with path info '/nice/long/patch/info/string'] -------------------------- Option 2) send all page request to index.php: Request: http://domainname.com/user => http://domainname.com/index.php?page=user Request: http://domainname.com/project => http://domainname.com/index.php?page=project Request: http://domainname.com/user/create => http://domainname.com/index.php?page=user/create [with path info '/create'] Request: http://domainname.com/project/delete/145786 => http://domainname.com/index.php?page=project/delete/145786 [with path info '/delete/145786'] I did read about a similar solution to option 2 in the cookbook but it wasn't clear on which Behavior Rules to apply this. For my current setup I would need option 1, but with some additional requirements. Current setup: BEHAVIOR RULES Extension .php (Check local file = enabled) - Handler: FastCGI (php-fpm) - Non Final Default - Handler: List and Send I need to but a cgi script in a subdirectory so all of the above should not influence this behavior. BEHAVIOR RULES Directory (/scm) - Handler: CGI (script Alias /location/file.cgi) - Final Extension .php (Check local file = enabled) - Handler: FastCGI - Non Final Default - Handler: List and Send Now I believe I need to put my php redirection below my cgi handler, because if a request matches /scm the cgi script will handle it because it's final. But I could use some advise how to set this up and still be able to access .css .jpg etc files Moroswitie _______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
