Document gone giving 404 rather than 410

I have the following in my .htaccess

RewriteRule "/docs/farming-project-proposal.pdf" "-" [G,NC]

but when I try to visit the page I get a 404 instead of a 410 error.

What am I missing?

Seems I was missing

ErrorDocument 410 /410.html

That and removing the leading slash seem to have done the trick.

There’s nothing quite like posting on a forum to find the answer for yourself! :rolleyes:

3 Likes

I was wondering about the G Flag - did you try adding a hyphen enclosed in quotes?:

http://httpd.apache.org/docs/2.4/rewrite/flags.html