Edgewall Software

Opened 18 years ago

Closed 18 years ago

Last modified 16 years ago

#469 closed defect (wontfix)

support arbitrary-length Trac URLs from trac.cgi

Reported by: ljb@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: general Version: 0.7
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:



we're currently using Trac as part of an integrated solution for large amounts of Su bversion repositories.

we use a Subversion repository per-project, and mod_rewrite magic to dispatch to the correct Trac installation (using the E: modifier for RewriteRule).

our Trac URLs take the form:


one of the RewriteRules looks something like:

RewriteRule /+trac/(.*?)/([/]+)/?(.*)$ /usr/share/trac/cgi-bin/trac.cgi/$3 [E=TRAC_ENV:/data/svn/trac/$1/$2,L]

as you can see, trac.cgi still gets a PATH_INFO of the form <project>/TRAC/EXTRA/STUFF

this all works fine, except for login/logout.

we need the extra bit so that our auth scheme dispatches to the correct <Location> matcher for per-project auth.

however, trac expects PATH_INFO for login/logout to be solely the "/login" or "/logout" strings.

we've patched it /usr/lib/python2.3/site-packages/trac/core.py locally to just check the end of the string, but i was wondering if you would consider doing this upstream?

as far as i can see, this would not impact on anything else.

in real_cgi_start(), we have these two replacement lines:

if path_info[-7:] == '/logout':


if path_info[-6:] == '/login':

Attachments (1)

core-py-substr-login-logout.patch (770 bytes ) - added by ljb@… 18 years ago.
patch for core.py

Download all attachments as: .zip

Change History (2)

by ljb@…, 18 years ago

patch for core.py

comment:1 by Jonas Borgström, 18 years ago

Resolution: wontfix
Status: newclosed

This will break if the repository contains files named 'login' or 'logout', sorry.

I still think it is possible to configure apache to get this to work: We have apache configured so http://projects.edgewall.com/<projectname>/wiki/FooBar will result in a PATH_INFO of "/wiki/FooBar/" I guess you should be able to do the same. You probably have to use a "PT" flag in your rewrite rule or something.

We currently use this rule:

ScriptAliasMatch /(trac|svngw|thelab)(.*) /usr/share/trac/cgi-bin/trac.cgi$2

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.