Can I 301 Redirect An Entire Subdirectory To Root?

Discussion in 'Apache' started by excaliburwebdesigners, Nov 1, 2007.

  1. #1
    I have ecommerce store located in subdirectory of my main domain, there is nothing on the main domain so i want to move my entire subdomain up to the sites root.

    The are several hundred pages in the store that will be moved up, is the an easy .htaccess mod to do this to tell search engines where the pages have all moved to, as a lot of inner pages have PR.

    I dont want my SERPS to be affected so a SEO friendly solution is required.

    Thanks in advance.
     
    excaliburwebdesigners, Nov 1, 2007 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Any time you make changes there is temporary hit.

    What you want to do may be possible.

    I would suggest just making a nice intro page on the root with a link to the store and leaving it as it is. Then if you want to promote the main domain you can.
     
    Colbyt, Nov 1, 2007 IP
  3. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thats kind of what i am doing currently, but the store index page in the subdirectory was duplicated to the domains index, so there are kind of 2 homepages both the same and was worried about a duplicate content penalty.

    Im getting 15K UV P/M so dont really want to do anything to disrupt that.
     
    excaliburwebdesigners, Nov 1, 2007 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    I don't think I would duplicate the page even though the dupe content penalty is very over-stated.

    I would try for some eye candy on the intro page.

    PM me the url if you like and I will look later. Keep in mind I am not a guru of any sort.
     
    Colbyt, Nov 1, 2007 IP
  5. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I found this bit of code on another forum

    RewriteEngine On
    RewriteBase /
    RewriteRule ^art/(.*)$ /$1 [R=301,NC,L]

    it works a treat, i had to correct a lot of other code in my .htaccess file as well but it all seems to be working :)

    The store was running at http://www.mazoo.co.uk/art/index.php

    now it redirects to the homepage

    http://www.mazoo.co.uk/index.php

    so where the store was creating product urls like

    http://www.mazoo.co.uk/art/cool-waters-modern-abstract-painting-canvas-p-475.html

    the mod will cut the subdirectory part of the url and 301 redirect to

    http://www.mazoo.co.uk/cool-waters-modern-abstract-painting-canvas-p-475.html

    I just have to remember to update some pages where i have specified some images to load from the old subdirectory and most importantly update my google sitemap.
     
    excaliburwebdesigners, Nov 1, 2007 IP
  6. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    " I don't think I would duplicate the page even though the dupe content penalty is very over-stated. "

    I would normally agree, however i have been steady link building and my site dropped from PR3 to PR2 and all my inner pages went from PR2 to PR1 and that was the only explanation i could come up with.
     
    excaliburwebdesigners, Nov 1, 2007 IP
  7. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #7
    A small word of advice. Donot redirect to /index.php.
    Just redirect to your domain name without the index.php.
    index.php is implicit. Otherwise with and without index.php
    creates a duplicate url problem.
     
    Kuldeep1952, Nov 2, 2007 IP
  8. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #8
    Second that, in fact, I just send 301 redirects from any index.* to the directory root, domain.com/
     
    krt, Nov 2, 2007 IP
  9. excaliburwebdesigners

    excaliburwebdesigners Peon

    Messages:
    501
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #9
    How would i do that?
     
    excaliburwebdesigners, Nov 3, 2007 IP