Create a 410 Redirect for Missing Files

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.

  • 107 Users Found This Useful

Was this answer helpful?

Related Articles

Disable error_log via htaccess

Disabling error_log Files via .htaccess   If your error_log file is growing large and...

Redirecting non-www to www with htaccess

Redirecting non-www to www with .htaccessIf you ever point your www. record to another server...

301 Redirect

This code will redirect all visitors who attempt to access the old-url.html page to the...

htaccess referral redirect

Setting Up a Referral Redirect With .htaccess   A referral redirect (also called a...

Nginx redirecting folder to another host or server

From time to time you may want to proxy out a path to another server or location. To perform a...



Save 30% on web hosting - Use coupon code Hosting30