Added forward rules

This commit is contained in:
2026-03-31 12:33:03 +02:00
parent bedf8bc335
commit 55348057a0
3 changed files with 48 additions and 8 deletions
+7
View File
@@ -16,6 +16,13 @@ func NewStaticHandler(storagePath string, siteMap map[string]config.SiteConfig)
}
urlPath := filepath.Clean(c.Path())
for _, rule := range site.ForwardRules {
if rule.Source == urlPath {
return c.Redirect().Status(rule.StatusCode).To(rule.Destination)
}
}
if urlPath == "/" || urlPath == "." {
urlPath = "/index.html"
}