410 status code issue with redirects

Hey there,

I’m trying to show up the 410 status code of the pages which have criteria of /*.pdf to 410. It’s saying to google that the page is gone and it’s not coming back.

I added this code in the _redirects page

#Redirects .pdf extension with the 410 status code
/*.pdf / 410

But when I tried to test with my crawling software, it shows 404 pages. So basically 404 error.

Here is the screenshot of it.

If you want to test the URL, here is some.


Any help in this is highly appreciated :slight_smile: Thanks.

Also, I created the _headers file and added the same information too and tested it. Same issue.

@sureshkumarg I am not sure the wild card you specified is working.

Try setting up the redirect with the full static path prior to the one you have there:

/effective-sustainability-communication-music-festivals-mega-events.pdf / 410

/*.pdf / 410

I believe there is not a match on the redirect you have so it falls through and ends up returning the 404 (missing) redirect. When I added the full path above (match) I get the 410 as expected.

1 Like

Talves, it worked for me. Thanks.

I’m trying to add a regex code to make it works. Everything having .pdf links get 410 status.

What is the best way to solve this with regex code?

Our redirects parsing does not currently support wildcards like *.pdf or regex. It only supports placeholders and path wildcards (at the end of paths). There is a feature request for it and I’ve added a reference to this thread so that if it gets implemented, we can let you know.


Thank you, Dennis. Hope this feature get shipped soon.