Handling legacy urls indexed by Google with Drupal 7

mindre end 1 minutters læsning

We recently switched to Drupal for vih.dk and a lot of pages has been moved around and given new names. We do not want to create a mapping from the old links to the new links. Instead we wanted to remove the old links from Google.

The problem

We were faced with one problem though. Even though the path did not exist anymore, it was still accepted but a different page was shown. This legacy url:


automatically pointed to:


Thus still giving a http response code 200 to Google.

Pages to the rescue

Page Manager from Ctools could help making some 404’s for custom paths. All we needed to do was adding a new page with the path I wanted to remove from Google, e.g.


And then add the response code 404 for that path. It works like a charm.

How would you solve this situation?



The redirect module (http://drupal.org/project/redirect) is probably the best way to handle this in Drupal 7. It allows you to create redirects with 3xx codes (301, etc), which will let Google know that the content has moved. From what I understand, using a 404 essentially throws away any SEO value you had from that page, so I would use a 301 to redirect to a relevant page. Nice tip on using page manager response codes though.

Dave Reid

This is what http://drupal.org/project/redirect is for - so you serve a 301 response code on the old URL that indicates to search engines that the page has moved rather than removing the old URL from the index and starting over with the new page.

Steven Jones

We used the Redirect module (http://drupal.org/project/redirect) to add 301 redirects from our old links to the new ones, this has the benefit of not making those pages ‘dead’ for a user that follows a link to them, in fact they probably don’t even notice they’ve been redirected.


I’d (almost) never 404 them, as that could possibly destroy the backlink juice you have on those pages. I’d 301 them to the new location, or to a page that has ‘sort of’ the same content if it’s not moved 1:1. This way Google (in time) will delete old urls from the index, you still have the backlink power, and you’ll give your users the best possible user experience. Even when the ‘old’ urls are deleted from Google’s index, there may still be links on blogs/forums/bookmarks/social sites. Giving those users a good experience is key, and keeping your backlink juice is also important for ranking.


While I would have likely put such a redirect in my htaccess file, this seems like a fairly nice solution if you are using page manager.


I think you chose the right approach. I would consider using 410 instead of 404 though, it just feels more accurate, even when both would get the same effect.


Can I recomment no queueing comments for approval? It allows for better/faster experience. (Mollom could help with spam)


Not very good solution from SEO point of view, as this way you loose all your search engine rankings you have earned so far for those pages. Much better solution would be to install Redirect module (http://drupal.org/project/redirect) and redirect all legacy URLs with 301 redirect (moved permanently) to their relevant new URLs (and that’s how it’s usually done when site’s URL are changing).


I just installed mollom based on your recommendation. However, I cannot seem to find where I can toggle whether comments needs to be approved first?


Thanks for all the comments. Actually they made me reconsider whether to do a 404. At first, I really did not want to spend time maintaining the links and just rely on Google to discover the new pages and eventually they will rank as high as the old pages. However, I think I will spend a couple of hours and make the redirects properly. I will consider the redirect module for that.

Skriv en kommentar

Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret *