Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Moving Entire Site into another Folder

    I've an ecommerce site which is fairly popular with google, but I need to move it to a different folder to make room for other products. I sell scooters, but am now wanting to have a section to sell jewelery, toys, and accessories. So each one will have its own folder with all of them linked to the index page.

    What I'm wondering is how I can move the existing pages to a folder and yet still be able to (1)have google find them, (2) have google know it's still the same content just in a different place, and (3) let google know the pages are permanently moved, change its links and stop crawling the old pages.

    How would I go about this?


    And I say "google", but also mean all search engines.
    <div> - putting your mind in a box since 1997

  • #2
    Regular Coder croatiankid's Avatar
    Join Date
    Jan 2006
    Posts
    665
    Thanks
    1
    Thanked 12 Times in 12 Posts
    there's a thing called a "301 redirect", which is the code that a page has been permenantly moved. you can read how to use it here.

    probably the easiest way to do it is with .htaccess. (as shown here). if you need more info, you cold probably find it on a search engine with phrases like 301 redirect, maybe add htaccess to it.

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    I don't understand why you would have "old pages" ...

    What if you had a separate directory for each section that only
    contained photos, and then had one catalog file that contained a
    list of items, their descriptions, prices, path to the photo ... and your
    index file was index.php ... a PHP script that would dynamically display
    your items using that catalog file. You would not have any other HTML
    pages, no static HTML pages, the other directories would only be used
    to store your images.

    To add items, you would add a couple of images to the appropriate
    directory, add a line item to the catalog.db (text file) and you're done.

    The only file the search engines would be concerned about was "index.php".

    That's typically what an online ecommerce site is like ... most use
    MySQL, but a simple flat-file (text file) would be the same type of thing.

    Websites usually don't have static pages anymore.

  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    Either way, the existing pages are going to move to a new URL (either a new directory or to a URL structure based on index.php using query strings, which by the way isn't a particularly good idea), hence the requirement for correct redirects to be in place.

    Croationkid is right, a 301 redirect is the correct way forward and .htaccess is your best option providing you're on an apache server.

  • #5
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Thumbs up

    Thanks guys, the 301 redirect was what I was looking for.

    mlseim: "old pages" meaning the URL of where the pages are now with respect to the duplicate ones in the new folder. The "old" URLs will have to stay for a while until google understands that everything has moved.


    Here's the sample PHP code I ended up using for this (tested and works):

    PHP Code:
    $sn getenv("SCRIPT_NAME");

    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: http://www.mysite.com/folder$sn"); 
    exit(); 
    Last edited by ArcticFox; 05-01-2007 at 09:28 PM.
    <div> - putting your mind in a box since 1997

  • #6
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts
    UPDATE

    One month later and Google still insists on indexing the old pages. I've also noticed that my search ranking has now slipped off the first AND second pages - I'm now being listed on the third google page!

    WTF is going on here? My sales and visitors have dropped to almost nothing!
    <div> - putting your mind in a box since 1997

  • #7
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    did you double check the header response?

    What's the URL of your site and the pages in question?

  • #8
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts
    How do I check a header response?

    basestationzero.com/ forwarding to basestationzero.com/xtreme/
    <div> - putting your mind in a box since 1997


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •