fix: HTTPS URLs in sitemap, robots, canonical + og:image on homepage
- Add UseForwardedHeaders middleware so Request.Scheme = "https" behind nginx - Add SITE_BASE_URL env var fallback for sitemap.xml, robots.txt, and all Razor page canonical/og URLs — set it to https://draletaha.ir in .env - Add og:image to homepage using hero photo - Add SITE_BASE_URL to docker-compose.yml environment block Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
@model DrSousan.Api.Pages.Blog.PostModel
|
||||
@{
|
||||
var post = Model.Post!;
|
||||
var baseUrl = Request.Scheme + "://" + Request.Host;
|
||||
var baseUrl = Environment.GetEnvironmentVariable("SITE_BASE_URL")?.TrimEnd('/') ?? (Request.Scheme + "://" + Request.Host);
|
||||
var canonicalUrl = baseUrl + "/blog/" + post.Slug;
|
||||
var ogImage = ViewData["OgImage"]?.ToString() ?? "";
|
||||
var articleType = ViewData["ArticleType"]?.ToString() ?? "MedicalWebPage";
|
||||
|
||||
Reference in New Issue
Block a user