Edgewall Software

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2149 closed defect (fixed)

Redirecting wiki page which ends with '/'

Reported by: Shunichi Goto <gotoh@…> Owned by: cboos
Priority: normal Milestone: 0.10
Component: wiki system Version: devel
Severity: minor Keywords: review
Release Notes:
API Changes:


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

    7171        action = req.args.get('action', 'view')
    7272        pagename = req.args.get('page', 'WikiStart')
    7373        version = req.args.get('version')
     74        if 1 < len(pagename) and pagename.endswith('/'):
     75            req.redirect(self.env.href.wiki(pagename[:-1]))
    7577        db = self.env.get_db_cnx()

Attachments (0)

Change History (7)

comment:1 Changed 10 years ago by Shunichi Goto <gotoh@…>


comment:2 Changed 10 years ago by cboos

  • Owner changed from jonas to cboos
  • Severity changed from normal to 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:3 Changed 9 years ago by cboos

  • Keywords review added

#2323 marked as duplicate.

comment:4 Changed 9 years ago by cmlenz

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:5 Changed 9 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

Implemented in r2635.

comment:6 Changed 9 years ago by cboos

  • Milestone set to 1.0

comment:7 Changed 9 years ago by cmlenz

  • Milestone changed from 1.0 to 0.10

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain cboos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from cboos 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.