Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2011
    Posts
    41
    Plugin Contributions
    0

    Default Adding sub categories to existing site - implications of

    When I first set up my site all categories are under General. Now one of my categories has too many products in and needs some organisation hence I want to add some sub categories. From what I understand I will need to remove all products from this category (Bulbs) and add the sub categories ie. Red, White, Blue and then place the products that were in the Bulbs category into the correct sub categories. Is this correct?
    At the moment my products in this Bulbs category are ranked highly in the search engine results, is adding these sub categories and moving the products in them going to mess up things with search engines ie page not found etc.
    Thanks
    Last edited by gowzel; 29 Oct 2012 at 08:33 AM. Reason: spelling

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Adding sub categories to existing site - implications of

    If you wanted the new categories to end up under the existing category, you could add a new Category at the Top level and then Move to your existing Category then Move Products into it ...

    Keep repeating that until ALL Products are out of the original category and into the subcategories ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding sub categories to existing site - implications of

    To keep your search engine results/ranking, you need to add 301 redirects from the old URLs to the new ones. This can be done in an .htaccess file. Search the forum or google for more info.
    This tutorial shows an example:
    http://www.zen-cart.com/content.php?...-dont-enter-it
    There are lots of tutorials online.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Adding sub categories to existing site - implications of

    I had to do this on one of my sites a while ago; here's a template for the 301 redirects in your .htaccess:
    Code:
    # Redirect &products_id=[1|2|6|10] from cPath=1 to cPath=6_7
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=1&products_id=(1|2|6|10)(&.*)?$
    RewriteRule ^(index\.php)?$ http://www.mysite.com/index\.php?main_page=%1&cPath=6_7&products_id=%2%3 [r=301,L]
    It might not be totally efficient, but it did the trick for me!

  5. #5
    Join Date
    Jun 2011
    Posts
    41
    Plugin Contributions
    0

    Default Re: Adding sub categories to existing site - implications of

    Thanks for the help.
    I dont think I would need any redirects as any links to the products would still link to the products as there id is the same. Any links to the category would still link to the category as the category will still be there, just not filled with products but filled with some new categories.
    i.e. My category now is 'bulbs' it has 60 products in it I am going to remove the products to a temp category and then in 'bulbs' add 3 new categories - 'red 'white' 'blue' then I am going to place the products from the temporary folder into the 'red' 'white' or 'blue' folders.

    Or will there be links out there in search engine land to both category and product i.e. :

    http://shop.xxxxxxxxx.co.uk/index.ph...products_id=34

    in which case I will need to make a redirect to all those product currently in category cpath=6

    EDIT: Ah I think the above post answers my question, Thankyou will look more closely now I have edited this
    Last edited by gowzel; 29 Oct 2012 at 03:42 PM. Reason: seen post above

  6. #6
    Join Date
    Jun 2011
    Posts
    41
    Plugin Contributions
    0

    Default Re: Adding sub categories to existing site - implications of

    Bulbs category presently is ID=6

    6 NEW CATEGORIES = A, B, C, D, E, F
    A=ID=12
    B=ID=13
    C=ID=14
    D=ID=15
    E=ID=16
    F=ID=17

    Product ID'S are 27 to 44 inclusive, 49, 58, 59, 62,63,64

    so is this correct?

    # Redirect &products_id=[27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|49|58|59|62|63|64] from cPath=6 to cPath=12_13_14_15_16_17
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=1&products _id=(27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|49|58|59|62|63|64)(&. *)?$
    RewriteRule ^(index\.php)?$ http://shop.xxxxxxx.co.uk/index\.php...oducts_id=%2%3 [r=301,L]

    Not sure on the '&products_id=%2%3'

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding sub categories to existing site - implications of

    The rewrite rule can't know which of the six new subcats a particular product should be redirected to without explicit direction. You will need a separate conditions and rule set for each new subcat with the group of products that redirect to it.
    The ...iews_write)&cPath=1 in your conditions needs to be &cPath=6 with the product id list tailored to each subcat,
    and the rules need to be like &cPath=6_12, &cPath=6_13, etc

  8. #8
    Join Date
    Jun 2011
    Posts
    41
    Plugin Contributions
    0

    Default Re: Adding sub categories to existing site - implications of

    I think this is correct now, but not sure on the %2%3 at the end of the url
    If I change the url to the correct one can I just copy and paste this as is in my htaccess file?
    Many many thanks, learning all the time

    # Redirect &products_id=[27|28|29|30] from cPath=6 to cPath=6_12
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(27|28|29|30)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_12&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[41|42|43|44] from cPath=6 to cPath=6_13
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(41|42|43|44)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_13&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[37|38|39|40|62|64] from cPath=6 to cPath=6_14
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(37|38|39|40|62|64)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_14&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[31|32|33|34|35] from cPath=6 to cPath=6_15
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(31|32|33|34|35)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_15&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[58|59] from cPath=6 to cPath=6_16
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(58|59)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_16&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[63] from cPath=6 to cPath=6_17
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(63)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_17&products_id=%2%3 [r=301,L]


    # Redirect &products_id=[36|49] from cPath=6 to cPath=6_18
    RewriteCond %{QUERY_STRING} ^main_page=(product_info|product_reviews|product_reviews_write)&cPath=6&products _id=(36|49)(&. *)?$
    RewriteRule ^(index\.php)?$ ttp://shop.xxxxxxx.co.uk/index\.php?main_page=%1&cPath=6_18&products_id=%2%3 [r=301,L]
    Last edited by gowzel; 29 Oct 2012 at 05:16 PM.

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Adding sub categories to existing site - implications of

    The %2 fills in the products_id and (I think) that the %3 fills in any remaining GET variables.

    If your .htaccess file doesn't include the following
    Code:
    # Start redirects
    Options -Indexes
    Options +FollowSymLinks
    RewriteEngine On
    add those lines before the redirects in your previous post.

    Remember to test, test and then test again!

 

 

Similar Threads

  1. v154 Change existing site from sub directory to the root of the web site
    By fjbern1943 in forum Installing on a Linux/Unix Server
    Replies: 21
    Last Post: 25 Jun 2015, 03:16 AM
  2. Adding to an existing web site
    By Adalast in forum Templates, Stylesheets, Page Layout
    Replies: 72
    Last Post: 11 Feb 2010, 09:33 PM
  3. Adding a Store to Existing Site
    By blakehouseinn in forum General Questions
    Replies: 8
    Last Post: 29 Jan 2010, 05:39 AM
  4. Adding a flash banner to categories and sub categories
    By shane09 in forum General Questions
    Replies: 0
    Last Post: 1 Jul 2009, 05:32 PM

Posting Permissions

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