mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 04:00:50 +00:00
autorouter when /admin 301 to /admin/
This commit is contained in:
parent
3d481178d7
commit
fd3c8834da
@ -544,6 +544,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
|
||||
if !findrouter {
|
||||
for cName, methodmap := range p.autoRouter {
|
||||
|
||||
if strings.ToLower(requestPath) == "/"+cName {
|
||||
http.Redirect(w, r, requestPath+"/", 301)
|
||||
return
|
||||
}
|
||||
|
||||
if strings.ToLower(requestPath) == "/"+cName+"/" {
|
||||
requestPath = requestPath + "index"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user