I've a job site and I want to redirect using 301 all expired jobs to one common page. All expired jobs are deleted. To make it easy the job urls have unix timestamp suffixed in some pattern so that I can recognize a url as expired job.
Whenever a page request comes, I want to let it go normally but if page is not found then only I want to check the url with specific pattern and then redirect 301 to common page if it is url of expired job.
Is there any way to do it?