Set Cache-Control header for 301 redirects
You first problem is that $status is not coming from anywhere. In a filter you need to accept arguments in your callback function. If the number of arguments you’re accepting is greater than 1 then you also need to specify that number as the 4th argument to add_filter(). You also need to return that value … Read more