Redirects should give absolute URLs
- Status
- Closed
- Subject
- Redirects should give absolute URLs
- Version
- 2.x
3.x - Category
- Error
- Feature
- All / Undefined
- Resolution status
- Fixed or Solved
- Submitted by
- MvGagern
- Lastmod by
- Ushindi Gedeon
- Rating
- Description
Per RFC 2616 Section 14.30
, the "Location" header given with a HTTP 3xx redirect response must be absolute. TikiWiki violates this requirement, and PHP doesn't fix it up again.
The instance I encountered was the index.php, but a simple "grep -ri 'header.*location' ." in the tikiwiki source tree will list hundreds of more instances of this problem. To see it in a live setup, monitor your network traffic (e.g. using Wireshark
) and visit the root directory of any tikiwiki site, e.g. http://dev.tikiwiki.org/
. You can then have a look at the HTTP response and notice the incorrect location header.
All user agents that I know of do accept a relative URL as the location of a redirect, and interpret it as relative to the URL of the original request. However, any user agent might decide not to follow such redirects, and it would still conform to HTTP specs. Tikiwiki shouldn't rely on browsers to accept broken behaviour.
- Solution
- Change all "header('location: ..." function calls so that they include the current scheme (http or https), host name, and an absolute path of the designated target. Probably best to move all this stuff to a new helper function, so that you have to implement and maintain all this environment detection only once.
- Workaround
- Importance
- 2
- Priority
- 10
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2696
- Created
- Wednesday 26 August, 2009 10:52:27 UTC
by Unknown - LastModif
- Thursday 28 May, 2026 13:18:49 UTC