Hey Bin Tan, 2008/10/22 Bin Tan <[EMAIL PROTECTED]>: > Suppose my application is deployed at http://localhost/cgi > I noticed witty can rewrite http://localhost/cgi/a/ to > http://localhost/cgi#/a/ > But if it's http://localhost:8080/cgi/%C4%82/ > I get 400 Bad Request
Oops. Fixed that! > Also, if the application is deployed at http://localhost/ > http://localhost/a/ will generate 404 Not found Now that is a bit of a tough issue. We had some choices there in implementing (the builtin the httpd), but all of the solutions have draw backs. We could simply forward every requests that starts with the prefix that matches your application deploy path to the application. This is what you seem to expect, but that has as consequence that you cannot serve plain files that match the same prefix. This is even worse if you deploy at the root '/': then your server cannot serve any plain files? We now only match an application with downstream paths if the trailing path info (it is called like that in CGI terms) starts with a '/', and thus if your application is deployed at a location that does not end in a '/'. That is also why you get the strange URLs that use a query argument rather than an internal path when generating internal path URLs when your application is deployed at a location ending with a '/': e.g. http://localhost/?_=/a/ > So should I avoid automatic rewriting? You mean using internal paths ? Currently it is not very compatible with deploying at the root ('/'), or indeed at any location ending with a '/'. What we could do is make an exception for deployments at the root '/': - for any non-root deployment path (e.g. /app or /app/) we forward anything that matches with that prefix interpreted as a directory to the application - for a root deployment path (/), we only use an exact match. But adding an exception also adds the risk of adding confusion? Regards, koen ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
