I recently updated our site taking it from a multi-page site to a single page site.

The problem now is that when the site is searched in say Google, it displays the site as well as the indexed pages. So if a user clicks say our "About" page, it takes them to our now outdated material.

I am hoping to get some guidance on how to properly handle this.

I figure the first step is to now setup a robots.txt on our new index page to tell the engines not to crawl beyond index.php.

But in the meantime, how do I handle the fact that when searching our site on Google we may still have users who try to click on sub-page links?

Should I simply setup redirects while waiting for the engines to update?

And if so, do I need to setup redirects on each page using PHP or is this something I would take care of on our sites control panel?

I am not very familiar with redirects...

Any help is appreciated!


The best thing to do is to use 301 redirects in your .htaccess file. Essentially Google or any browser looking for a page (for this example, the About Us page) gets redirected to the page you want them to see. This is done instantly really, and requires no "You are being redirected, please stand by" messages.

The code is:

RewriteRule ^name-of-old-page/$          /name-of-new-page/         [R=301,L]
  • Sounds prefect, does this mean that i need to add an entry for each page that I do not want them to see or is there an inverse way of doing this, i.e. any page EXCEPT index.php -> redirect to index.php? – Stefan Jul 9 '12 at 14:25
  • I found this lil snippet, does this sound right? RewriteRule !^index\.php$ /index.php [L,R=301] – Stefan Jul 9 '12 at 14:29
  • Yes you'll have to add it for each page that you wish to redirect. The snippet you have isn't right, it'll be ^index.php$ if you were going to do that. – mickburkejnr Jul 9 '12 at 14:31
  • Ok sounds good thank you for the help. Now if I add a robots.txt telling the search engines not to crawl beyond index.php, will the engines such as google slowly remove those sub-page links that they show when I search for the site? – Stefan Jul 9 '12 at 14:35
  • I will be honest, I'm not entirely sure. You could try re-submitting your site to Google, so that it will then recrawl the site. If the pages it used to have can't be found any more then it should remove these. – mickburkejnr Jul 10 '12 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.