]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
beautify_urlpath: add ./ before checking for /index.html
[ikiwiki.git] / IkiWiki.pm
index 47116089bdac0f66b15bb02fbcd8f3410e42d41b..97c835cf6281c986600af120b1338a4ac01392d1 100644 (file)
@@ -949,16 +949,16 @@ sub formattime ($;$) {
 sub beautify_urlpath ($) {
        my $url=shift;
 
-       if ($config{usedirs}) {
-               $url =~ s!/index.$config{htmlext}$!/!;
-       }
-
        # Ensure url is not an empty link, and if necessary,
        # add ./ to avoid colon confusion.
        if ($url !~ /^\// && $url !~ /^\.\.\//) {
                $url="./$url";
        }
 
+       if ($config{usedirs}) {
+               $url =~ s!/index.$config{htmlext}$!/!;
+       }
+
        return $url;
 }