This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20290 - redirect from URLs with trailing slashes
Summary: redirect from URLs with trailing slashes
Status: RESOLVED FIXED
Alias: None
Product: webplatform.org
Classification: Unclassified
Component: infrastructure (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Denis Ah-Kang
QA Contact: public-webplatform-bugs list
URL:
Whiteboard:
Keywords:
: 20865 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-12-07 11:42 UTC by Mike Sierra
Modified: 2013-02-04 15:55 UTC (History)
4 users (show)

See Also:


Attachments

Description Mike Sierra 2012-12-07 11:42:49 UTC
When you tell someone a URL, he often habitually adds a trailing slash as on most websites:

http://docs.webplatform.org/wiki/tutorials/device_orientation/

This results in an empty new-page UI. Suggest configuring server to redirect.
Comment 1 David Kirstein (Frozenice) 2012-12-07 19:22:10 UTC
Personally I think it's not an issue, I don't know anyone who does that.

Nonetheless I guess it would be possible to set up in Apache.
Comment 2 Jonathan Garbee 2012-12-07 19:28:25 UTC
It is just a UX issue for those that add a trailing slash.  I don't think it affects many people.  Nonetheless it can be done in apache using some rules [1].

[1] http://stackoverflow.com/questions/3082825/mod-rewrite-remove-trailing-slash-only-one
Comment 3 Mike Sierra 2012-12-15 13:24:52 UTC
I assume there's also a marginal chance someone might casually navigate to "page/", see there's no content there, then create the page even though content already exists at "page".
Comment 4 Jonathan Garbee 2012-12-15 13:31:46 UTC
I don't see any reason to go through the trouble of making a page dynamically with the content that is supposed to be there when we can do a simple .htaccess rule to get people to the right page.
Comment 5 Jonathan Garbee 2013-02-04 15:16:11 UTC
*** Bug 20865 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Garbee 2013-02-04 15:17:51 UTC
In bug 20865 Doug pointed out what should be the proper rewrite rule to add to the .htaccess file. That is:

RedirectMatch permanent ^/wiki/(.*)/$ /wiki/$1
Comment 7 David Kirstein (Frozenice) 2013-02-04 15:23:18 UTC
Nice tagging Garbee, had already forgotten about this one. :)

Regex looks reasonable. I was just pondering if there are any (special) pages that require a trailing slash in certain cases, but couldn't think of any.

Permanent is OK, too, as we don't want to have content under the trailing-slash-URL later anyways.

So, LGTM.
Comment 8 Denis Ah-Kang 2013-02-04 15:55:13 UTC
The redirect has been added to all 5 applications servers.
Thanks Garbee!