Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Auto-redirect to category

         

Gemini23

12:26 pm on Mar 30, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Anyone any suggestions on how to do this - I think it should be possible via htaccess.

With a large number of events coming and going throughout the year, and these getting indexed... as and when they pass and get automatically deleted (via woocommerce) is it possible to automatically redirect any 404 deleted post/product to its category?

ie categoryapples/postname - >>> gets deleted categoryapples/deletedpostname >>> 404 >>> any visitors REDIRECTED to categoryappples/

TorontoBoy

1:46 pm on Mar 30, 2019 (gmt 0)

5+ Year Member Top Contributors Of The Month



I have not heard of this, but would be interested to learning how to do this. Usually deleted WP pages get a themed 404 page.

not2easy

1:53 pm on Mar 30, 2019 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Most themes (afaik) allow you to customize a 404.php so that you could easily add in a prominent section suggesting the categories along with the links.

Why is that preferable to an automatic redirect? Because redirecting to a page that does not have the content listed in serps and is not a 404 is viewed by Google as a soft 404. Google doesn't like soft 404s, sees it as a poor user experience.

Gemini23

1:54 pm on Mar 30, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am not sure how search engines deal with this - my guess is that the urls just drop off... perhaps an 'optimised' 404 page would be a better option... but in this case, the actual category would equally seem a fair option.

Gemini23

2:08 pm on Mar 30, 2019 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Not2easy - I posted my comment as you must have been in the middle of posting yours...