Opened 19 years ago
Closed 19 years ago
#4767 closed enhancement (wontfix)
Trac doesn't alow the addition of trailing slashes.
| Reported by: | Owned by: | Christopher Lenz | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | web frontend/mod_python | Version: | |
| Severity: | trivial | Keywords: | helpwanted |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
I wish to append a trailing slash to all request on my Trac installation but this causes Trac to baulk.
I have tried to change things with mod_rewrite but have failed.
After digging around in the code I found that the WSGIRequestHandler is reading the raw request line and hence I cannot fool Trac with environment variables or local URI rewriting.
The only solution to this that I can see is to add a configuration option to Trac much like Djangos APPEND_SLASH that lets you control if the request line is to ignore (strip) trailing slashes.
Attachments (0)
Change History (4)
comment:1 by , 19 years ago
| Keywords: | needinfo added |
|---|
follow-up: 3 comment:2 by , 19 years ago
The rest of my domain uses trailing "/" characters at the end of URLs. I would like to keep with this president for consistency and aesthetics.
You are correct about WSGIRequestHandler, I was looking in the wrong place. I believe there is a function called dispatch_foo or something which handles all the requests. All it would take to implement a fix for this would be to honour the REQUEST_PATH environment variable.
You can set this variable with mod_rewrite and would allow Apache to rewrite Tracs URI namespace.
comment:3 by , 19 years ago
| Keywords: | helpwanted added; needinfo removed |
|---|---|
| Priority: | normal → low |
| Severity: | normal → trivial |
| Type: | defect → enhancement |
Replying to anonymous:
All it would take to implement a fix for this would be to honour the REQUEST_PATH environment variable.
Care to provide a patch? I don't see any reference to REQUEST_PATH in the Apache documentation. Be aware that for #2299 the SCRIPT_URL variable is now read to determine the URL path before rewriting.
comment:4 by , 19 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
I have changed my mind on this now. Unless there was a way to configure Trac to actually link to URIs with a trailing slash there would be a permanent redirect issued and two requests generated for every single resource request. I am closing as wontfix, if you don't mind.



Can you explain why you want/need to do this? Trac allows for URLs with trailing slashes when appropriate, but I don't see a reason to have them appended to every request. Also, I'm pretty sure
WSGIRequestHandleris not actually involved in the processing of mod_python requests. It's used as part of tracd for parsing the HTTP request.