What can you do about old website URLs that are still indexed by Google?
I received this question recently:
I was just contacting you to ask you about some of the links from my original website. When I put my name into a search engine quite a few pages from my original website come up like the news page etc and when you click on these it does take you to my new site with a page not found message. I was wondering what I should do about this, is there a way to stop these results showing? It isn’t too bad as someone could still go to the links and get to active pages but I was a little worried that it could send people away. I am hoping you may be able to help?
The backstory
(Skip the personal stuff and get to the useful info)
For about 15 years, I had a small scale business in developing, maintaining and hosting websites. I have been winding this down now that I am back in full time employment as I can’t guarantee to have time available (sometimes on very short notice) to give my long standing clients the kind of service that they should be able to expect.
So a few months ago I asked my last few web hosting clients to move to alternative hosting in time for me to close down my reseller account before the end of the tax year.
The last clients out were also my first clients, a family of very talented artists based in Devon. It was always wonderful to see their new paintings and follow their news events over the years, and even though it was my choice, I consider myself very lucky to have worked for them and I was sorry to see that go.
Anyway…
My former client decided, rightly, that it was time to move on from the very nice website she had designed, and I had built, to showcase her paintings and news back in 2006. The simplicity of using plain HTML, CSS and minimal vanilla Javascript had left it less prone than some to errors caused by ageing software and scripting, but although it had lasted well, technology and visual design styles are always moving on. Responsive design wasn’t such a concern back then, for example, whereas designing for phones, tablets, and bigger screens as well, is far more important now.
She decided on building and hosting her new site with a company called FASO (Fine Art Studio Online), that specialises in hosting and marketing artists’ websites, and her new website looks lovely and much more modern. You can see it here: https://www.kirstybonning.co.uk/
So, what can be done with old URLs?
This is what I advised:
(And of course I offered to help with any of it as required – one way or another, it has been sorted out though).
There are several good ways to improve on this issue of old links from Google, and it depends what kind of access you have to your website files.
-
Making good use of your 404 error page
One way is to get access to the page or page section that displays the page not found (404) error, and put something more useful, welcoming or informative there – perhaps a message, some links to your best pages, or a site search box.
These are actually good ideas for making your website more visitor friendly anyway.
-
301 Redirects
Another way is to redirect the old page URLs to where you would want them to go to instead. The type of redirect you would want to do is called a 301 (or permanent) redirect, and the way to do it depends on what type of server is hosting your website.
-
Apache Web Server Redirects
If your website is running on an Apache web server (as most do) you need access to a hidden file in your website’s root directory called
.htaccess
This file can be created and edited in a plain text editor, but if you do change the
.htaccess
file you should definitely back up a copy of it first, because if there are mistakes or conflicts with other website code it could take the website offline until you put the old.htaccess
back.These are the lines to add to
.htaccess
:
First,
RewriteEngine on
Then a series of lines moving old URLs to new ones like this (the
/
would be at the end of your domain name but before any directories):
Redirect 301 /old-page.html /new-page.html
-
If your web server is not Apache (it could be Windows or Nginx), there are slightly different ways to do the same thing.
For reference, here are instructions for redirects on Windows and Nginx servers, which I didn’t send as I thought it would be overkill:
-
Windows Server Redirects
On a Windows server, redirects are added to a file called
web.config
which is in the site root directory. This page from Bowler Hat explains how to do this: 301 Redirects for SEO from Windows Server & IIS.They advise:
There are a few things to note about the syntax used for making 301 redirects from IIS on window servers in a
web.config
file. Firstly, everything is wrapped up in<configuration></configuration>
tags and secondly, the value set in thehttpResponseStatus
should be'Permanent'
to issue the 301 code we are looking for.Finally, the code for redirecting one page to another page is structured like this:
<location path="page-to-redirect.html">
<system.webServer>
<httpRedirect enabled="true" destination="http://www.destination.co.uk/new-page.html" httpResponseStatus="Permanent" />
</system.webServer>
</location> -
Nginx Server Redirects
I’ve never worked with Nginx, but the ‘Using maps’ section of this post by Bjørn Johansen looks like the way to do what we want: How to do an Nginx redirect. He recommends creating a mapping file (eg
redirect-map.conf
) with a structure like this:map $request_uri $redirect_uri {
/about.html /about-us;
/customers.html /our-customers;
}This mapping file would then be defined outside the server block, like this:
include redirect-map.conf;
server {
[…]
if ( $redirect_uri ) {
return 301 $redirect_uri;
}
}The server block is usually found in a configuration file called
nginx.conf
-
- If you don’t have access to your website or server configuration files, we still have three options left that don’t need it:
-
Change your new page URLs to match the old ones
If you’re not able to access any of these files, you could consider changing your new URLs to be the same as the old ones, but then if the new ones have also already been indexed by search engines you would have the same issue with them.
-
Submitting a Sitemap to Google Search Console
Another thing you could do is to create a Google Search Console account (this used to be called Google Webmaster Tools) and submit a sitemap to them, which will speed up the reindexing process. Here is some information about that: https://support.google.com/webmasters/answer/156184
It’s a great idea to add your website to Google Search Console anyway, as it can give you detailed information about how your site is performing, and how that changes over time.
-
Last Option: Do Nothing
Alternatively, if you don’t do anything at all, eventually search engines will stop showing the old links anyway.
-
Last Last Option: Social Media
As a final thought, remember to check all the links to your website from your social media accounts, comments and posts, and make sure you’re using the new URLs in any links you have access to edit. A couple of new social media posts with the new URLs should also speed up the indexing process.
Have you got other tips to solve this problem? I’d love to hear them in the comments. Thanks!
Links
- Google Search Central: Move a site with URL changes
- Ahrefs blog: 301 Redirects for SEO: Everything You Need to Know
- 301 Redirects for SEO from Windows Server & IIS
- How to do an Nginx redirect
- Google Search Central: Learn about sitemaps
- Google Search Central: Build and Submit a Sitemap
- Submitting a Sitemap to Google
- Google Search Central: Beginners guide to Search Console
- Kirsty Bonning, Landscape Artist
(Image by Mohamed Hassan. Licence: Pixabay)
Leave a Reply