Chuyển đến nội dung
Skillpedia
SEO75k · #3061

trailing-slash

Skill này làm gì

Skill này kiểm tra xem site có dùng một kiểu URL nhất quán, có hoặc không có dấu gạch chéo cuối hay không. Skill dành cho chủ site và lập trình viên muốn tránh trang trùng lặp trong tìm kiếm.

Khi nào nên dùng

  • ✓Khi site phục vụ cùng một trang ở cả địa chỉ có và không có dấu gạch chéo cuối.
  • ✓Khi liên kết nội bộ, sitemap và thẻ canonical dùng các kiểu URL khác nhau.
  • ✓Khi site đã chuyển sang nền tảng mới và các quy tắc URL có thể đã thay đổi.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/trailing-slash/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/trailing-slash/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Google hiển thị một số trang của tôi hai lần, một lần có dấu gạch chéo ở cuối và một lần không. Bạn có thể sửa các URL không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra cả hai phiên bản URL cùng các liên kết nội bộ và sitemap. Sau đó agent gợi ý một kiểu ưu tiên duy nhất, với chuyển hướng vĩnh viễn từ kiểu còn lại.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Use trailing slashes consistently

Inconsistent trailing slashes create duplicate content — Google sees /page and /page/ as two separate URLs competing for the same ranking, splitting PageRank between them.

Quick Reference

  • Pick one convention — trailing slash or no trailing slash — and enforce it site-wide with 301 redirects
  • Both /page/ and /page must not return HTTP 200; one must redirect to the other
  • Set rel="canonical" to the preferred version on all pages
  • Ensure all internal links, sitemaps, and canonical tags use the same convention

Check

For a sample of URLs, test both the trailing-slash and non-trailing-slash versions. Both should NOT return HTTP 200 — one must 301-redirect to the other. Check that internal links, sitemap <loc> values, and canonical tags all use the same convention consistently.

Fix

Choose a canonical URL convention. Add server or framework redirect rules so the non-preferred variant permanently redirects (301) to the preferred one. Update all internal links, canonical tags, and sitemap entries to use the preferred format.

Explain

Explain why /page and /page/ are treated as distinct URLs by default, how this creates duplicate content, and how 301 redirects and canonical tags resolve the ambiguity.

Code Review

Review metadata generation, rendered HTML, structured data, and response headers related to Use trailing slashes consistently. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/seo/trailing-slash

Câu hỏi thường gặp

Vì sao hai URL bị coi là khác nhau?

Mặc định, công cụ tìm kiếm xem /page và /page/ là hai địa chỉ riêng, nên các tín hiệu xếp hạng bị chia nhỏ.

Các trang trùng lặp được xử lý thế nào?

Skill khuyên chuyển hướng 301 từ phiên bản không ưu tiên, và dùng thẻ canonical trên các trang.

Tôi có nên cập nhật sitemap không?

Có. Skill nói rằng các mục sitemap nên dùng cùng định dạng với URL ưu tiên.

Chi tiết

Mô tả gốc của tác giả

Use when applies to all static and dynamic websites. Use when auditing a site for duplicate content, setting up a new site, or after migrating platforms that changed URL conventions.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#3061
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự