Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default [Done v157a] Deleted category results in noindex,nofollow

    Still present in zc157, but applicable to prior versions as well.

    If a category has been removed, any category-listing page-links that were previously slurped by a search engine can't be removed since the Zen Cart response to an invalid category results in the page being met with a <meta name="robots" content="noindex, nofollow" /> link instead of an HTTP-301 (moved permanently).

    You can see this behavior with a demo-products' install by attempting to access the site's /index.php?main_page=index&cPath=99999. I'm just wrestling with what the 301-redirect should (er) redirect to ... new_products (some sites don't use this page), all_products (ditto) or the home page.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Deleted category results in noindex,nofollow

    The correct response for a category that no longer exists is an HTTP response of 410-Gone or 404-Not-Found

    Given that there's no tracking to know that it was "once present but is now deleted", the 404 is most appropriate.

    In v1.5.7 logic was added to centralize how to do 4xx vs 2xx responses regarding "products":
    https://github.com/zencart/zencart/pull/2551
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Deleted category results in noindex,nofollow

    Quote Originally Posted by DrByte View Post
    The correct response for a category that no longer exists is an HTTP response of 410-Gone or 404-Not-Found

    Given that there's no tracking to know that it was "once present but is now deleted", the 404 is most appropriate.

    In v1.5.7 logic was added to centralize how to do 4xx vs 2xx responses regarding "products":
    https://github.com/zencart/zencart/pull/2551
    Thanks, DrByte; I appreciate the update.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Deleted category results in noindex,nofollow

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Deleted category results in noindex,nofollow

    OK, here's the approach I'm looking at:


    1. If the current-category-id isn't found in the database, i.e. existed previously and removed or never existed:
      1. Issue a 404 (not found) header
      2. Reset the breadcrumbs
      3. Indicate that the page should include noindex,nofollow

    2. Otherwise, if the current category is disabled
      1. Issue a 410 (Gone)
      2. Indicate that the page should include noindex,nofollow
      3. Display "No products exist in this category"

    3. Otherwise,the current category exists and is enabled
      1. Proceed 'normally', displaying any products present within that category.


    Once the basic approach has been accepted, I'll be happy to submit a GitHub Pull-Request (PR).

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Deleted category results in noindex,nofollow

    What options will be available for those that wish no indication of a category existing, disabled or otherwise? Simple notifier/observer option to change the 410 to a 404 and trigger/reset the breadcrumbs or perhaps support some other response code as seen fit for the application making the edit?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Deleted category results in noindex,nofollow

    Quote Originally Posted by mc12345678 View Post
    What options will be available for those that wish no indication of a category existing, disabled or otherwise? Simple notifier/observer option to change the 410 to a 404 and trigger/reset the breadcrumbs or perhaps support some other response code as seen fit for the application making the edit?
    I was planning on adding a notification, similar to the product-related handling referenced by DrByte in post #2 of this thread.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Deleted category results in noindex,nofollow

    Quote Originally Posted by lat9 View Post
    OK, here's the approach I'm looking at:


    1. If the current-category-id isn't found in the database, i.e. existed previously and removed or never existed:
      1. Issue a 404 (not found) header
      2. Reset the breadcrumbs
      3. Indicate that the page should include noindex,nofollow

    2. Otherwise, if the current category is disabled
      1. Issue a 410 (Gone)
      2. Indicate that the page should include noindex,nofollow
      3. Display "No products exist in this category"

    3. Otherwise,the current category exists and is enabled
      1. Proceed 'normally', displaying any products present within that category.


    Once the basic approach has been accepted, I'll be happy to submit a GitHub Pull-Request (PR).
    Seems sensible to me.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. [Done v157a] Product Master Category Bug
    By Footie1 in forum Bug Reports
    Replies: 7
    Last Post: 26 Oct 2020, 10:49 AM
  2. Replies: 7
    Last Post: 10 Jul 2009, 02:27 PM
  3. Noindex Nofollow???
    By batteryman in forum General Questions
    Replies: 6
    Last Post: 29 Apr 2007, 11:04 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR