I had a folder called blog on my site. I deleted it all permanently. I would like to 410 it. How do i 410 an entire folder?
e.g. my site looked like this
For those who are using IIS (7 or above) and stumble across this post as i did, this is how I wound up doing it using the global.asax:
void Application_BeginRequest(object sender, EventArgs e)
{
HttpApplication app = sender as HttpApplication;
if (app.Request.Url.PathAndQuery.IndexOf("/mydirectory") > -1)
{
Response.StatusCode = 410; Response.End();
}
}
I happened to be looking for all pages in a directory, but I could have done something similar like targeting all html pages (assuming 410’ing ALL html pages were to be “gone”)