marty:1493251065 wrote
/wiki/ doesn't redirect.
(NOTE: Not sure if it's clear but /wiki/ is my install folder for dokuwiki. And I'm using the DokuWiki Template.)
So everything navigational (header link homepage, breadcrumbs, sitemap) points to /wiki/start.
But the canonical link in the header code for /wiki/start is actually /wiki/.
And if I then go to /wiki/ it doesn't redirect, it displays the content of /wiki/start.
Looks like the canonical link is wrong for this page?
Yes, quite clear what you're describing. However, when you say "/wiki/ doesn't redirect", I can't agree with you.
When you visit the /wiki/ directory, your webserver will default to looking at index.php. Inside that, the very first content is a comment:
index.php wrote In normal usage, this script simply redirects to doku.php
This redirection is handled by the first bit of code:
if(php_sapi_name() != 'cli-server') {
header("Location: doku.php");
exit;
}
doku.php in turn loads inc/init.php, which loads inc/common.php, inside which is this code:
if($id === '') {
$id = $conf['start'];
}
If you didn't have
URL rewriting switched on in your wiki, you'd notice that your URLs would look like this, which is how they were on initial install:
http://yoursite.com/wiki/doku.php?id=start
With URL rewriting switched on, this becomes:
http://yoursite.com/wiki/start
And you can also leave off the ?id=start to see the exact same page - this is what is happening in your case when you visit:
http://yoursite.com/wiki/
That code above from inc/common.php is saying "if no value for id was specified, I'm going to assume you wanted to see 'start'".
You could argue that isn't a redirect,
and it's true that it's not actually performing an HTTP redirect (edit: not true! it is doing an HTTP redirect! see post below). However, in effect /wiki/ is indeed redirecting to /wiki/start . As I mentioned in a previous post, /wiki/ cannot correlate to a page in your wiki hierarchy, because is no wiki content available above :start
Hope that helps? :-)