diff --git a/src/components/SeoGenerator/SeoGenerator.tsx b/src/components/SeoGenerator/SeoGenerator.tsx index be3801c7..a1d76960 100644 --- a/src/components/SeoGenerator/SeoGenerator.tsx +++ b/src/components/SeoGenerator/SeoGenerator.tsx @@ -61,6 +61,7 @@ const SeoGenerator: FC = ({ preloadImages, }) => { const router = useRouter(); + const isUserProfile = router.pathname.startsWith('/user/'); if (forceNoIndex && canonicalOverride) { return ( @@ -114,7 +115,7 @@ const SeoGenerator: FC = ({ = ({ ))} - {pathname.includes('/user') ? ( + {isUserProfile ? ( ) : ( { export default Certificate; export async function getServerSideProps(context) { + context.res.setHeader('X-Robots-Tag', 'noindex, nofollow'); const userId = context.params.userId; const certificate = await getCertificate(userId); if (!certificate) context.res.statusCode = 404; diff --git a/src/uxcore/components/SeoGenerator/SeoGenerator.tsx b/src/uxcore/components/SeoGenerator/SeoGenerator.tsx index c271f218..81b15cb9 100644 --- a/src/uxcore/components/SeoGenerator/SeoGenerator.tsx +++ b/src/uxcore/components/SeoGenerator/SeoGenerator.tsx @@ -88,7 +88,7 @@ const SeoGenerator: FC = ({ !pathname.includes('/uxcgdiy') && !pathname.includes('/uxcgstory'); const isUXCPPage = pathname.includes('/uxcp'); - const isUserProfile = pathname.includes('/user'); + const isUserProfile = router.pathname.startsWith('/user/'); const isUXCatPage = pathname.includes('/uxcat'); let favIconPath = '/assets/favicon.svg'; @@ -108,7 +108,7 @@ const SeoGenerator: FC = ({ = ({ /> - {pathname.includes('/user') ? ( + {isUserProfile ? ( ) : (