Using a custom 410 page

I’ve been trying to figure this out without success.

In created a 410.php in my theme, and in my nginx config, I added:-

Read More

error_page 410 /index.php?error=410

as I’d seen suggested in a few places, but as I saw mentioned in other places, that doesn’t work out. I just get the 404 page instead (returned with a 410 response).

I saw the mentions of http://wordpress.org/plugins/wp-410/ but this is not what I want – I want to create 410 errors at the nginx level, and have nginx redirect them to a 410 page generated by WordPress.

Can anyone tell me the right way to do this, please?

Frankly, if there’s a correct way to send 410’s to the 404 page, I can customise the 404 page to look at the query parameters and tweak the text accordingly – not ideal, but it would do the job.

Related posts