Fix rewrite regex to match the start of the URL and not a substring
This commit is contained in:
parent
b5819d8f4d
commit
77221b3555
2 changed files with 8 additions and 5 deletions
|
|
@ -237,7 +237,10 @@ func buildLocation(input interface{}) string {
|
|||
|
||||
path := location.Path
|
||||
if len(location.Redirect.Target) > 0 && location.Redirect.Target != path {
|
||||
return fmt.Sprintf("~* %s", path)
|
||||
if path == "/" {
|
||||
return fmt.Sprintf("~* %s", path)
|
||||
}
|
||||
return fmt.Sprintf("~* ^%s", path)
|
||||
}
|
||||
|
||||
return path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue