Welcome to WebmasterWorld Guest from 107.21.183.163

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Force a 410 error

     

georgeek

7:48 pm on Mar 14, 2013 (gmt 0)

10+ Year Member



Hi -

Google has indexed pages that do not exist on my site. At the moment webmaster tools says the are 404s but I want to change them to 410s.

In .htaccess I have pages for the errors:

ErrorDocument 404 /404.htm
ErrorDocument 410 /410.htm

and I have:

RewriteEngine On
RewriteRule ^/it-doesnot.exist - [G]

But the browser still returns a 404 for this url.

Any ideas?

g1smd

8:30 pm on Mar 14, 2013 (gmt 0)

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



Remove the leading slash from the RegEx pattern.

Paths are localised on a "per-directory" basis before being presented to mod_rewrite.

georgeek

8:50 pm on Mar 14, 2013 (gmt 0)

10+ Year Member



Perfect - Thank you!