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

301 Redirect

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

htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

To solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable” follow...

Disable error_log via htaccess

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

Show longer file names in directory/folder index

If you've ever wanted to show longer file names in your directory listing just create or edit an...

What are all these htaccess files?

Understanding .htaccess Files on Your Hosting Account   If you look through your hosting...



Save 30% on web hosting - Use coupon code Hosting30