Mobile app version of vmapp.org
Login or Join
Kevin317

: How to correctly handle redirect after site facelift 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

@Kevin317

Posted in: #Php #Redirects #Sitemap

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!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin317

1 Comments

Sorted by latest first Latest Oldest Best

 

@Margaret670

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]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme