Added forward rules
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user