IIS to Apache Migration - 301 Redirect for hundreds of URL's

Discussion in 'Apache' started by tearcashflow, Jan 29, 2010.

  1. #1
    Hey,

    I'm migrating over a web site store from IIS to Apache. This site hosts hundreds of items, all of which have an item number contained in the URL. The new Apache-hosted site will be a completely new structure, and will also contain the item number in the URL. It will be on the exact same domain name, but just have a new structure. Can I refer all links directed to the old web site to the root directory of my site, and then have an .htaccess file containing a 301 redirect and perimeters for deciphering the requested old URL and forwarding it to the new URL? I don’t want to lose my search engine statistics I currently have for so many aspects of the site.


    Basically my logic is:


    A specific Item on invalid link is requested:

    http://www.example.com/store/items/itemnumber=9217


    When link is clicked, Apache recognizes that the requested path and will cache the url, and refer to the root directory of the new example.com website:

    http://www.example.com/


    Contained in the root directory, there will be parameters in the .htaccess file that will recognize that the URL requested is for a link on the old site:

    http://www.example.com/store/items/itemnumber=9217


    The htaccess file will then compare the old path with specific parameters and recognize that it was for a specific item:

    http://www.example.com/store/items/itemnumber=9217


    Once Apache knows it’s a request for an item, it will then collect the item number at the end of the URL:

    http://www.example.com/store/items/itemnumber=9217


    Once collected, it will input the collected value into an appropriate new website URL:

    http://example.com/index.php/sku=9217


    Apache then forwards the page to the new URL, and tells google via the 301 redirect code that the new URL for this page is:

    http://example.com/index.php/sku=9217



    I need Google and other Search engines/links to know the path has changed without hurting my search results. I also need all old requests to be forwarded to the new ones.

    Will this logic work?
     
    tearcashflow, Jan 29, 2010 IP
  2. Mika Mustalahti

    Mika Mustalahti Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    I may be forced to go through similar process. Could you share how did it go with you?
     
    Mika Mustalahti, Aug 18, 2010 IP
  3. MrYu

    MrYu Peon

    Messages:
    157
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    MrYu, Aug 18, 2010 IP