301 redirects

by 11 replies
14
hi there guys and gals hope everyone is having a great weekend

my question to you is this

i have been building a testing a website on my server and it's been indexed but when it goes live it will be running on it's on domain name so two questions:
i want to do a redirect - all pages are html - can i add a .htaccess to the directory where they are stored ie they are stored in a directory called projects which is a sub directory of the root directory

second question how do i then make sure the pages on the test server get de-indexed so that the new site on the correct domain will get indexed

thanks

r
#programming #301 #redirects
  • You can use an htaccess file to return code 301 and redirect browsers to the new location. Just make sure that the htaccess file is left where the site is currently. (no good to have the htaccess under the new domain.)

    Google Webmaster has a tool to tell the search engine that a domain has been changed. However, it sounds like your site is currently living in a sibfolder of another domain, so this may not apply to you. Telling Google about your domain change - Webmaster Tools Help

    -Ryan
    • [ 1 ] Thanks
    • [1] reply
    • 1. Redirects in htaccess is easy:

      Code:
      Redirect 301 /your-old-page.html hxxp:// www . site . com/your-new-page.html

      2. Google will automatically de-index your pages if they are unavailable...
      • [ 1 ] Thanks
  • thanks guys that's really helpful ok once i get the new domain i will do that, however since the test pages are in say mywebsitedomain.com/projects/myproject.html shoud i put a .htaccess in the projects folder or can i put it in the .htaccess for example
    Redirect 301 /projects/your-old-page.html hxxp:// www . site . com/your-new-page.html
    • [ 1 ] Thanks
  • absolute start ryan but thanks to all for their great help (as usual!)
  • Also it depends from your web hosting provider if it has (I hope that it has ) when you can do your redirects in cPanel and directadmin. It is even much easier...
    • [ 1 ] Thanks
    • [2] replies
    • To tell Google to stop indexing the pages, just put them in robots.txt for a while.
      • [1] reply
    • Fabulous answer thanks so much
  • Nick, I believe the process of re-indexing pages is a question of months before old pages are gone.

    Just make sure the old pages redirect with a Code 301 (permanent redirect) and things will get sorted out.

    -Ryan
    • [1] reply
    • Thanks Ryan, does this affect the indexing of the new pages?

Next Topics on Trending Feed