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,36 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { getCanonicalUrlClient } from '@/lib/getCanonicalUrl';
|
||||
|
||||
/**
|
||||
* Client-side canonical URL handler
|
||||
* Use this component in pages that need dynamic canonical URLs
|
||||
* that can't be determined at build time or in generateMetadata
|
||||
*/
|
||||
export default function CanonicalHandler() {
|
||||
useEffect(() => {
|
||||
// Only run on client side
|
||||
if (typeof window === 'undefined') return;
|
||||
|
||||
const canonicalUrl = getCanonicalUrlClient();
|
||||
|
||||
if (canonicalUrl) {
|
||||
// Check if canonical link already exists
|
||||
let canonicalLink = document.querySelector('link[rel="canonical"]');
|
||||
|
||||
if (canonicalLink) {
|
||||
// Update existing canonical link
|
||||
canonicalLink.href = canonicalUrl;
|
||||
} else {
|
||||
// Create new canonical link
|
||||
canonicalLink = document.createElement('link');
|
||||
canonicalLink.rel = 'canonical';
|
||||
canonicalLink.href = canonicalUrl;
|
||||
document.head.appendChild(canonicalLink);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
return null; // This component doesn't render anything
|
||||
}
|
||||
Reference in New Issue
Block a user