Add support to autoredirect from non slash terminated URLs to name matched subfolders with index pages #1

Merged
restitux merged 2 commits from autoredirect-v5.3.0-dev into wiki.ohea.xyz-production 2022-10-07 23:18:11 +00:00
Showing only changes of commit 8714157262 - Show all commits
+4 -1
View File
@@ -625,7 +625,10 @@ module Precious
def show_page_or_file(fullpath)
wiki = wiki_new
if page = wiki.page(fullpath)
if page = fullpath[-1] != '/' ? wiki.page("#{fullpath}/#{wiki.index_page}") : false
redirect_path = "#{fullpath}/#{wiki.index_page}"
redirect to("#{encodeURIComponent(redirect_path)}")
elsif page = wiki.page(fullpath)
@page = page
@name = page.filename_stripped
@content = page.formatted_data