Browse Source

canonical 링크 추가

조회 파라미터가 붙은 주소가 별도 페이지로 색인되는 것을 막는다.
metadataBase + alternates.canonical './' 조합으로 현재 경로 기준 정규 주소를 낸다.
(antooza.com)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
KIM-JINO5 14 giờ trước cách đây
mục cha
commit
6ad143a87e
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      app/layout.tsx

+ 4 - 0
app/layout.tsx

@@ -76,6 +76,10 @@ export async function generateMetadata(): Promise<Metadata> {
     const metaAdds = parseMetaAdds(config?.meta?.adds);
 
     return {
+        // 정규 주소(canonical). './' 는 현재 경로로 해석되므로
+        // 쿼리스트링이 붙은 주소가 별도 페이지로 색인되는 것을 막는다.
+        metadataBase: new URL('https://antooza.com'),
+        alternates: { canonical: './' },
         title: config?.basic?.siteName ?? '개미투자',
         description: config?.meta?.description ?? '',
         keywords: config?.meta?.keywords ?? '',