update seo perma link

This commit is contained in:
aichy126 2023-06-01 11:25:25 +08:00
parent 3e219569b6
commit 40f66f505c
1 changed files with 2 additions and 2 deletions

View File

@ -184,9 +184,9 @@ func (tc *TemplateController) QuestionInfoeRdirect(ctx *gin.Context, siteInfo *s
titleIsAnswerID = true
}
}
siteInfo = tc.SiteInfo(ctx)
url = fmt.Sprintf("%s/questions/%s", siteInfo.General.SiteUrl, id)
if siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionID {
if siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionID || siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionIDByShortID {
if len(ctx.Request.URL.Query()) > 0 {
url = fmt.Sprintf("%s?%s", url, ctx.Request.URL.RawQuery)
}