recently I've updated my website from AJAX to ASP.MVC5, so the old urls which are still in the search engine need to be removed.
Because my old URLs is AJAX based, Google will not gonna remove them it self since every old urls will re-direct to the homepage , for example :
mysite.com/#!product/phone/samsung/galaxy3
mysite.com/#!product/phone/iphone/ip4s
mysite.com/#!product/phone/nokia/lumia920
Now the solution is return to Google an 401 HTTP error status everytime the server receive a request from the old URL (contains #!
or _escaped_fragment_
)
How do I return this 401
HTTP error status code back to the requester
proactively in MVC5 ? Thanks alot!