diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go
index c9d63fec5d..080388f01f 100644
--- a/routers/web/org/projects.go
+++ b/routers/web/org/projects.go
@@ -232,9 +232,11 @@ func EditProject(ctx *context.Context) {
 		return
 	}
 
+	ctx.Data["projectID"] = p.ID
 	ctx.Data["title"] = p.Title
 	ctx.Data["content"] = p.Description
 	ctx.Data["redirect"] = ctx.FormString("redirect")
+	ctx.Data["HomeLink"] = ctx.ContextUser.HomeLink()
 
 	ctx.HTML(http.StatusOK, tplProjectsNew)
 }
diff --git a/routers/web/repo/projects.go b/routers/web/repo/projects.go
index e15f548a38..91e17dee29 100644
--- a/routers/web/repo/projects.go
+++ b/routers/web/repo/projects.go
@@ -232,6 +232,7 @@ func EditProject(ctx *context.Context) {
 		return
 	}
 
+	ctx.Data["projectID"] = p.ID
 	ctx.Data["title"] = p.Title
 	ctx.Data["content"] = p.Description
 	ctx.Data["card_type"] = p.CardType
diff --git a/templates/projects/new.tmpl b/templates/projects/new.tmpl
index 85ceddec60..1314884da6 100644
--- a/templates/projects/new.tmpl
+++ b/templates/projects/new.tmpl
@@ -48,7 +48,7 @@
 				<div class="ui divider"></div>
 				<div class="ui left">
 					{{if .PageIsEditProjects}}
-					<a class="ui primary basic button" href="{{.RepoLink}}/projects">
+					<a class="ui primary basic button" href="{{$.HomeLink}}/-/projects{{if eq .redirect "project"}}/{{.projectID}}{{end}}">
 						{{.locale.Tr "repo.milestones.cancel"}}
 					</a>
 					<button class="ui green button">
diff --git a/templates/repo/projects/new.tmpl b/templates/repo/projects/new.tmpl
index 25959be7a3..b0b5ed024f 100644
--- a/templates/repo/projects/new.tmpl
+++ b/templates/repo/projects/new.tmpl
@@ -72,7 +72,7 @@
 				<div class="ui divider"></div>
 				<div class="ui left">
 					{{if .PageIsEditProjects}}
-					<a class="ui primary basic button" href="{{.RepoLink}}/projects">
+					<a class="ui primary basic button" href="{{.RepoLink}}/projects{{if eq .redirect "project"}}/{{.projectID}}{{end}}">
 						{{.locale.Tr "repo.milestones.cancel"}}
 					</a>
 					<button class="ui green button">