Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

410 gone for entire domain with custom 410

3:49 pm on Dec 4, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Nov 15, 2007
votes: 1

I want to do a 410 gone for an entire domain, using a custom 410 gone doc.

Since the 410 gone error doc has to be on the same domain to work properly, of course I hit a snag using something simple like:

ErrorDocument 410 /410.htm
redirect gone /

Since this is a wordpress installation set up not to use file suffixes, I can't do it that way either.

Any thoughts?
8:53 pm on Dec 4, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
votes: 244

If you're yanking the whole domain, why don't you also delete the htaccess that came with wordpress? Then you can do anything you want to.

Just make sure you've got an exception for the 410 page itself, otherwise you will get an infinite loop ending in a 500-class error.
11:56 pm on Dec 4, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
votes: 0

Something like this?

# Error Doc
ErrorDocument 410 /gone.php

# Send 410 Gone for all requests
RewriteCond %{REQUEST_URI} !^/gone\.php
RewriteRule .* - [G]

If example.com/gone.php is directly requested it could return "200 OK" unless the first line of the PHP file is itself:
HEADER ("HTTP/1.1 410 Gone");

or similar.

Check the PHP manual for the exact syntax for generating this error message.