homepage Welcome to WebmasterWorld Guest from 50.17.176.149
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Force a 410 error
georgeek




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

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




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

Remove the leading slash from the RegEx pattern.

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

georgeek




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

Perfect - Thank you!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved