docs: #307 redirecting VAZN pages to SIMI pages

This commit is contained in:
Hamid Reza Mohammadi 2022-04-25 20:41:53 +04:30
parent dad39f97df
commit e02785f3ca
2 changed files with 14 additions and 5 deletions

View File

@ -580,6 +580,16 @@ namespace GanjooRazor.Pages
{
return StatusCode(503);
}
if (Request.Path.ToString().IndexOf("index.php") != -1)
{
return Redirect($"{Request.Path.ToString().Replace("index.php", "search")}{Request.QueryString}");
}
if (Request.Path.ToString().IndexOf("vazn") != -1 && Request.QueryString.ToString().IndexOf("v") != -1)
{
return Redirect($"{Request.Path.ToString().Replace("vazn", "simi")}{Request.QueryString}");
}
LastError = "";
LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Token"]);
CanEdit = Request.Cookies["CanEdit"] == "True";
@ -607,11 +617,6 @@ namespace GanjooRazor.Pages
return Redirect(pageUrl);
}
if (Request.Path.ToString().IndexOf("index.php") != -1)
{
return Redirect($"{Request.Path.ToString().Replace("index.php", "search")}{Request.QueryString}");
}
await preparePoets();
if (!IsHomePage)

View File

@ -201,6 +201,10 @@ namespace GanjooRazor.Pages
Metre = Request.Query["v"];
Rhyme = Request.Query["g"];
Metre ??= "";
Rhyme ??= "";
if(!string.IsNullOrEmpty(Rhyme))
{
Rhyme = Rhyme.Replace(" ", "");