Technical SEO & Schema · FREE SEO UTILITY

Trailing Slash Canonical 301 Rule Enforcer (Apache, Nginx & Next.js).

Eliminate duplicate /page vs. /page/ indexation splits with file-safe Apache .htaccess, Nginx and Next.js rules that never break .xml or .pdf assets.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
rewrite ^/(.*)/$ /$1 permanent;

How to use this in your SEO workflow

  • Align your internal <a href> links, XML sitemap URLs and canonical tags with your chosen trailing-slash policy to avoid internal 301 hops.
  • Always exclude paths containing file extensions (.xml, .txt, .pdf, .webp) when adding trailing slashes.
  • Keep homepage root / untouched when stripping trailing slashes.
Map full URL redirects in Site Migration
More utilities in this category:

Related in-depth SEO guides

SEO Academy