1

I'm having problems removing old content from Google search results. One of the suggestions was to redirect the old pages to 410 error page so google would know to drop these pages.The original website was built in WordPress. I'm using Netlify and hugo now.

  • The old pages www.example.com/?product=...
  • My new pages are www.example.com/products/...

I tried

  • /product/* 410.html 410
  • /?product/* 410.html 410

in my _redirects file but no luck. I also have https://prestoshears.netlify.com https://prestoshears.com 301 in _redirects.

How can I configure this properly?

  • I'm not sure that we have any Netlify experts here, you might do better by trying to contact their customer support. I hope somebody here can answer your question, but most folks here are more familiar with .htaccess on Apache, Nginix, or even IIS. – Stephen Ostermiller Nov 28 '18 at 1:18
  • ok thank you. I tried to ask my question in their community but no answer. Hopefully someone can help out. – Nidaa Bogis Nov 28 '18 at 21:58
  • So I read in other comments that it's better to use 301 redirect so I don't lose my ranking on the old pages. However, google search result only shows old headlines and ignores the new one which is not good and not what I want so I thought 410 is the right approach. correct? – Nidaa Bogis Nov 28 '18 at 22:00
2

I recommend you use the 301 permanent redirect.

Netlify allows for query params to be captured at the time of the redirect. The params are lost after a redirect, so you have to make an EXACT match.

The correct way would be to add a _redirect entry for the query param like so:

/ product=:product /products/:product 301

Note: I know this is a little late. When I went to one of your old links, the value was no longer there on the new site. For the old search below I would expect to see a page at /products/presto-shears-5-5-inches-11 based on your explanation above.

enter image description here

  • By EXACT match you mean I list all the links to the old products? I can't do * for anything that matches whatever before it? yeah what you saw is actually old. My new links don't have product any more. I used shears and accessories now. That's my problem these old links keep showing in the search but I have a redirect to the home page when any of it is clicked – Nidaa Bogis Dec 20 '18 at 18:36
  • Based on your original question, my answer is the way you would have accomplished what you needed. Now that you have changed the value of the product paths, you would have to make a redirect mapping for each and every product. – talves Dec 20 '18 at 18:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.