summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorStephen Warren <swarren@wwwdotorg.org>2010-02-22 22:13:59 +0100
committerAndreas Gohr <andi@splitbrain.org>2010-02-22 22:13:59 +0100
commit7873e7571e67c02167e5747441a2c6be32b07267 (patch)
treeb8154ce5d5437c6394890a9846b73f17abd38b2f /inc/pageutils.php
parent4fc51abc5736d818d029640029d3de0f8ab8cc15 (diff)
downloadrpg-7873e7571e67c02167e5747441a2c6be32b07267.tar.gz
rpg-7873e7571e67c02167e5747441a2c6be32b07267.tar.bz2
Redirect to start page for the root namespace too
Dokuwiki emits an HTTP redirect when accessing: /path/to/some/namespace/ to force the browser to: /path/to/some/namespace/$conf['start'] However, this doesn't happen for the root namespace itself. In some ways, this doesn't really matter, since accessing plain "doku.php" will show the root namespace "start" page even without the redirection. Equally, this can be trivially fixed using mod_rewrite rules, but I don't want to encode the start page name into my rewrite rules. Finally, I like the consistency of always having the start page name in the URL, rather than special-casing the root namespace. (Actually, I'd prefer never to have it in the URL, but that looks more complex to achieve). Anyway, the attached patch makes the redirect happen for the root namespace as well.
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 239ff41c5..b6b1d048b 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -60,7 +60,7 @@ function getID($param='id',$clean=true){
}
// Namespace autolinking from URL
- if(substr($id,-1) == ':' || ($conf['useslash'] && substr($id,-1) == '/')){
+ if(substr($id,-1) == ':' || ($conf['useslash'] && substr($id,-1) == '/') || $id == ''){
if(page_exists($id.$conf['start'])){
// start page inside namespace
$id = $id.$conf['start'];