Unidiff1 files changed, 10 insertions, 9 deletions
|
diff --git a/cgit.c b/cgit.c index 166fbc6..d1cee58 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -441,13 +441,15 @@ int main(int argc, const char **argv) |
441 | |
441 | |
442 | /* If virtual-root isn't specified in cgitrc and no url |
442 | /* If virtual-root isn't specified in cgitrc, lets pretend |
443 | * parameter is specified on the querystring, lets pretend |
443 | * that virtual-root equals SCRIPT_NAME. |
444 | * that virtualroot equals SCRIPT_NAME and use PATH_INFO as |
| |
445 | * url. This allows cgit to work with virtual urls without |
| |
446 | * the need for rewriterules in the webserver (as long as |
| |
447 | * PATH_INFO is included in the cache lookup key). |
| |
448 | */ |
444 | */ |
449 | if (!ctx.cfg.virtual_root && !ctx.qry.url) { |
445 | if (!ctx.cfg.virtual_root) |
450 | ctx.cfg.virtual_root = ctx.cfg.script_name; |
446 | ctx.cfg.virtual_root = ctx.cfg.script_name; |
| |
447 | |
| |
448 | /* If no url parameter is specified on the querystring, lets |
| |
449 | * use PATH_INFO as url. This allows cgit to work with virtual |
| |
450 | * urls without the need for rewriterules in the webserver (as |
| |
451 | * long as PATH_INFO is included in the cache lookup key). |
| |
452 | */ |
451 | path = getenv("PATH_INFO"); |
453 | path = getenv("PATH_INFO"); |
452 | if (path) { |
454 | if (!ctx.qry.url && path) { |
453 | if (path[0] == '/') |
455 | if (path[0] == '/') |
@@ -463,3 +465,2 @@ int main(int argc, const char **argv) |
463 | } |
465 | } |
464 | } |
| |
465 | |
466 | |
|