Patrick Stox, a Product Advisor, Technical SEO, & Brand Ambassador at Ahrefs, provides a comprehensive guide on the use of redirects in SEO.
Redirects are used to send users and bots to a new URL when the old URL has changed locations. They are essential for SEO as they help combine signals between pages and assist search engines in determining which page to show to users.
Redirects can be permanent or temporary, and can be server-side or client-side.
Permanent redirects are used when:
- The URL of a webpage or other resource is permanently changed
- Migrating to a new domain
- Switching from HTTP to HTTPS
- Fixing non-www/www duplicate content issues
- Merging two or more pages or websites
- Changing the URL structure of your website
Temporary redirects are used when:
- Redirecting users to the right version of the site for them (based on location/language)
- A/B split-testing the functionality or design of a webpage
- Running a promotion and redirecting visitors to a sales page temporarily
Redirects can be implemented at the server-level, DNS-level, or CDN-level. Server-side redirects are preferred for SEO.
Stox also discusses best practices for redirects, such as redirecting HTTP to HTTPS, using HSTS, avoiding long redirect chains, redirect loops, and overly broad redirects, and keeping redirects for at least 1 year.
He also provides tips on troubleshooting redirect issues, such as figuring out what system the redirects are in, checking if redirects happen only for specific user-agents, and being aware that redirects can throw the wrong status codes.
Stox concludes by recommending the use of regular expressions for matching patterns for bulk URL redirects.