Implement multi-domain SEO improvements:
- Add metadata to login and login-verify pages to prevent indexing. - Update robots.txt to disallow additional sensitive paths. - Enhance sitemap generation to filter by city and include accurate last modified dates. - Refactor canonical URL generation to support multi-domain architecture, ensuring self-canonicalization for city domains. - Remove deprecated CanonicalHandler component and streamline canonical URL handling. - Introduce safe JSON-LD output to prevent XSS vulnerabilities. - Add payment layout with appropriate metadata to prevent indexing. - Conduct a comprehensive technical SEO audit and implement necessary fixes across the application.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import { cache } from "react";
|
||||
import DoctorPage from "@/components/doctor";
|
||||
import Layout from "@/components/layout/StLayout";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
import { getRequestOrigin } from "@/lib/getCanonicalUrl";
|
||||
import { safeJsonLd } from "@/lib/sanitize";
|
||||
import { imageUrl } from "@/helper";
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
const FALLBACK_IMG = "https://www.nobat724.com/assets/images/logo.png";
|
||||
const FALLBACK_IMG = "https://nobat724.com/assets/images/logo.png";
|
||||
|
||||
const getDoctor = cache(async (slug) => {
|
||||
try {
|
||||
@@ -72,10 +75,12 @@ export async function generateMetadata({ params }) {
|
||||
|
||||
async function Doctor({ params }) {
|
||||
const { slug } = await params;
|
||||
const origin = await getRequestOrigin();
|
||||
let comments = null;
|
||||
let rateAggregate = { point: 0, satisfaction: 0, averages: [] };
|
||||
|
||||
const doctor = await getDoctor(slug);
|
||||
if (!doctor) notFound();
|
||||
|
||||
if (doctor) {
|
||||
try {
|
||||
@@ -99,9 +104,9 @@ async function Doctor({ params }) {
|
||||
? {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Physician",
|
||||
"@id": `https://www.nobat724.com/doctor/${doctor.uuid}#physician`,
|
||||
"@id": `${origin}/doctor/${doctor.uuid}#physician`,
|
||||
name: `دکتر ${doctor.name}`,
|
||||
url: `https://www.nobat724.com/doctor/${doctor.uuid}`,
|
||||
url: `${origin}/doctor/${doctor.uuid}`,
|
||||
...(specialtyNames && { medicalSpecialty: specialtyNames }),
|
||||
...(doctor.img?.[0]?.url && {
|
||||
image: {
|
||||
@@ -155,12 +160,12 @@ async function Doctor({ params }) {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
itemListElement: [
|
||||
{ "@type": "ListItem", position: 1, name: "خانه", item: "https://www.nobat724.com" },
|
||||
{ "@type": "ListItem", position: 1, name: "خانه", item: origin },
|
||||
{
|
||||
"@type": "ListItem",
|
||||
position: 2,
|
||||
name: specialtyLabel,
|
||||
item: `https://www.nobat724.com/doctors?specialty=${encodeURIComponent(specialtyLabel)}`,
|
||||
item: `${origin}/doctors?specialty=${encodeURIComponent(specialtyLabel)}`,
|
||||
},
|
||||
{ "@type": "ListItem", position: 3, name: `دکتر ${doctor.name}` },
|
||||
],
|
||||
@@ -172,13 +177,13 @@ async function Doctor({ params }) {
|
||||
{jsonLd && (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(jsonLd) }}
|
||||
/>
|
||||
)}
|
||||
{breadcrumbJsonLd && (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbJsonLd) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbJsonLd) }}
|
||||
/>
|
||||
)}
|
||||
<Layout>
|
||||
|
||||
Reference in New Issue
Block a user