#1305 closed defect (wontfix)
Using SCRIPT_NAME as path to trac.cgi leads to 'unprettied' links when using lighttpd
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.8.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
With lighttpd configured to rewrite /dev/ as /cgi-bin/trac.cgi, SCRIPT_NAME is set to /cgi-bin/trac.cgi. This differs from Apache where it would be set to the URL before it is rewritten — /dev/. This results in generated links being of the form /cgi-bin/trac.cgi/timeline/, which are less than perfect.
Attachments (1)
Change History (4)
by , 20 years ago
Attachment: | trac-script-name.patch added |
---|
comment:1 by , 20 years ago
Arguable, this is a lighttpd problem. Also, REQUEST_URI
isn't officially part of the [CGI specification http://www.faqs.org/rfcs/rfc3875.html].
comment:2 by , 20 years ago
I took this up with the lighttpd developer, and he said that their interpretation was valid according to the specification. A glance at the CGI spec shows that it is vague on the semantics of SCRIPT_NAME
so that appears to be true. As you noted though, the only work-around requires relying on a non-standard variable.
I agree that it would be preferable to convince lighttpd to bring it's interpretation of SCRIPT_NAME
into line with Apache's, but in the mean time don't see this patch causing any problems as it will fall back to the current behaviour if REQUEST_URI
isn't available.
comment:3 by , 20 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I have reached the conclusion that this is a lighttpd
issue. Users wishing to use lighttpd
with Trac should apply the attached patch, and contact the lighttpd developers to raise their awareness of this issue.
Patch that calculates the path to Trac based on REQUEST_URI, QUERY_STRING and PATH_INFO. When REQUEST_URI is not available (I believe this is the case for IIS on Windows), fall back to SCRIPT_NAME. Tested with Apache 2 and lighttpd.