Trailing backslash at domain in URLs when installed in DocumentRoot
- Status
- Closed
- Subject
- Trailing backslash at domain in URLs when installed in DocumentRoot
- Version
- 2.x
3.x
4.x - Category
- Error
- Patch
- Feature
- All / Undefined
Installer (profiles, upgrades and server-related issues)
Infrastructure
OS independence (Non-Linux, Windows/IIS, Mac, BSD) - Submitted by
- stefricht
- Volunteered to solve
- Philippe Cloutier
- Lastmod by
- Philippe Cloutier
- Rating
- Description
In my installation, on some internal links that are represented in an absolute way, there is a backslash between the domain name and the first slash.
Eg when I try to login on http://mydomain.com/index.php, I get redirected to http://mydomain.com\/tiki-login.php, which the server cannot render.
Clean install of:
MS Windows Server 2003 SE SP2 on x86
Apache 2.2.10
MySQL 5.1.30
PHP 5.2.8
TikiWiki 2.2Tiki resides directly in the DocumentRoot C:\tiki (as it is a dedicated server).
In tiki-setup.php, there is a line
Copy to clipboard$tikiroot = dirname($_SERVER['PHP_SELF']);
In the documentation of dirname, they state that since PHP 4.3.0, dirname returns unexpected values. The example implies that on Windows dirname('/x') returns '\'.Therefore, if you install Tiki in the DocumentRoot, _SERVER'PHP_SELF' will be '/filename.php' and $tikiroot will be '\'.
- Solution
- Fixed for Tiki 5 in r27191.
- Workaround
Since this seems to be the only special case, adding
Copy to clipboardif ($tikiroot == '\\\\') $tikiroot = '/';
somewhere appropriate, eg before
Copy to clipboardif ( substr($tikiroot,-1,1) != '/' ) $tikiroot .= '/';
works for me. Otherwise, a regex should help. However, I'm not too familiar with Tiki's source; maybe there are other places.- Importance
- 1 low
- Priority
- 5
- 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
- 2224
- Created
- Monday 15 December, 2008 14:15:17 UTC
by Unknown - LastModif
- Tuesday 25 May, 2010 05:41:59 UTC