Redirect folder to root

Discussion in 'Apache' started by brandonvd, Jul 22, 2011.

  1. #1
    Well I thought this would be simple, but I guess I just can't figure it out.

    I have a site at:

    http://www.mydomain.com/my-store

    It has folders in it like:

    http://www.mydomain.com/my-store/my-folder/

    It also has products like:

    http://www.mydomain.com/my-store/my-folder/my-product.html

    I just moved my store from the subfolder it was in to the root directory on my server. Now I need to redirect everything.

    So from:

    http://www.mydomain.com/my-store

    To:

    http://www.mydomain.com

    And:

    http://www.mydomain.com/my-store/my-folder/

    To:

    http://www.mydomain.com/my-folder/

    And:

    http://www.mydomain.com/my-store/my-folder/my-product.html

    To:

    http://www.mydomain.com/my-folder/my-product.html

    Obviously I can just do a bunch of 301 redirects for each product and folder, but that would take forever and I'd have a huge .htaccess file.

    Does anyone know of a shorter/easier way to do this?

    Thank you,

    Brandon
     
    brandonvd, Jul 22, 2011 IP
  2. rndm

    rndm Greenhorn

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    So, anytime someone tries to access anything under /my-store/ you want to 301 the request to / appending everything after the slash in the original request correct? Do you want to redirect or simply represent the content as living under the root (hide the my-store folder)?
     
    rndm, Aug 19, 2011 IP