Google seems to have many pages in its index that I deleted years ago.
My site currently has only the home page at
What do I do in Apache to permanently remove all those deleted pages from the Google index?
Two things you want to do.
- At a server level, setup 301 redirects (if you want your visitors to be redirected to your homepage) or 404 responses (if it doesn't matter that your visitors see a 'page not found' message). Either individually for each page, or setup a sitewide rewrite rule to catchall
- Log into your Google Search Console account and request the pages be removed from the index.
Don't forget to do this in Bing Webmasters also.