Creating a 410 Gone Redirect for Removed Pages
A 410 response tells search engines that a page has been permanently removed and will not be coming back. This is different from a 404 (not found), which could be temporary. Using 410 helps Google deindex removed pages faster.
How to Set Up a 410 in .htaccess
Add these lines to your .htaccess file for each URL you want to mark as gone:
RewriteEngine On
RewriteRule ^old-page.html$ - [G,L]
The [G] flag tells Apache to return a 410 Gone status. You can add multiple RewriteRule lines for multiple URLs.
When to Use 410 vs 301
- 301 Redirect: Use when the content has moved to a new URL. This passes link value to the new page.
- 410 Gone: Use when the content is permanently removed with no replacement. Google will deindex the URL.
- 404 Not Found: The default for missing pages. Google eventually deindexes 404 pages but slower than 410.
After adding 410 rules, you can use Google Search Console > Removals to request expedited deindexing of specific URLs.
