#2149 closed defect (fixed)
Redirecting wiki page which ends with '/'
| Reported by: | Owned by: | Christian Boos | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | wiki system | Version: | devel |
| Severity: | minor | Keywords: | review |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
If I request to wiki page url with slash at the end of url (i.e. .../wiki/StartPage/),
trac says "Describe "Start/" here" althou 'StartPage' is exist.
To allow structured wiki pages, I think it is better that trac treat
".../wiki/StartPage/" page as ".../wiki/Startpage".
Here's a sample patch by using redirection:
-
web_ui.py
71 71 action = req.args.get('action', 'view') 72 72 pagename = req.args.get('page', 'WikiStart') 73 73 version = req.args.get('version') 74 if 1 < len(pagename) and pagename.endswith('/'): 75 req.redirect(self.env.href.wiki(pagename[:-1])) 74 76 75 77 db = self.env.get_db_cnx()
Attachments (0)
Change History (7)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
| Owner: | changed from to |
|---|---|
| Severity: | normal → minor |
I think it's a good idea.
However, it might be surprising, as it's an exception to the normal rule for explicit wiki page links, where the WikiPageNames syntax is ignored: e.g. wiki:About/ would here link to the About wiki page, instead of the expected "About/" page.
But as I think it would be troublesome to allow creating a page with an ending "/", it's OK for me. Others?
comment:4 by , 20 years ago
This is a good idea in my opinion. I'd drop the 1 < len(pagename) part from the condition, which isn't needed AFAICT.
comment:6 by , 20 years ago
| Milestone: | → 1.0 |
|---|
comment:7 by , 20 years ago
| Milestone: | 1.0 → 0.10 |
|---|



s/structured/hierarchical/