Redirecting traffic from deleted help center articles

Return to top

46 Comments

  • Sawako Kubo

    Hi

    This redirecting code was working just fine, but I just found out it is not working now. When I access the old page, 404 page shows up.

    I added the new and old ID in the script today, but I didn't change other parts of the code.

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Sawako! I took a look at your help center and it looks like you aren't following the instructions in the article correctly. It states that you need to add the script before the JQuery function runs, however you have it after that line. Please move that above and let us know if that resolves it for you.

    0
  • Sawako Kubo

    Greg Katechis

    Thank you for checking my code!

    The following code is already written right above the redirecting code. Could you see the attachment?

    $(document).on("click", function() {
    $(".share-label").attr("aria-selected", "false");
    });

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Right, which is the issue...it's supposed to be above that and you have it below it.

    0
  • Sawako Kubo

    Greg Katechis

    I moved the following code, but it still doesn't work.

    $(document).on("click", function() {
    $(".share-label").attr("aria-selected", "false");
    });

    0
  • Greg Katechis
    Zendesk Developer Advocacy
    And are you seeing any errors in the console that may help this situation?
    0
  • Sawako Kubo

    Greg Katechis

    no errors

    0
  • Sawako Kubo

    Greg Katechis

    Now it's working! thank you for helping me.

    The problem was in other part of code.

    0
  • Product Team

    Honestly, I am in awe that the Zendesk product team considered this release ready.

    It's unreasonable to expect your users—help docs and technical writers—to have to know JavaScript to configure basic redirects for duplicate or obsolete pages. This is functionality that should have had a full WYSIWYG decade ago in the platform.

    0
  • Josh H

    HeyGreg Katechis,

    I look in our script.js file and it doesn't have the below line:

    $(document).ready(function() {

    If that's missing, can we simply add it? Do you know which line would be the best place to add it? Thank you.

    0
  • Greg Katechis
    Zendesk Developer Advocacy

    Hi Josh! I took a look at your help center and it is pretty heavily customized, so I'm assuming that's the reason that you're not seeing it. I would recommend talking to the devs that built that to see how they developed it to see if they can steer you in the right direction. As it stands, it really wouldn't be possible for me to tell you how to proceed in this situation, so they will be your best bet!

    1
  • Ani

    HiGreg Katechis,

    Please take a look at my code as well. I have copy-pasted part of it here. Reading thru the comments, I have added it within the ready function. I don't see any jquery code above my code. Can you please help me understand why the code isn't working. As soon as I click on the old article link, I keep hitting this zendesk auth page.

    (function () {

    "use strict";

    ready(function () {

    //Redirect old/deleted article links to new ones

    varoldIds= ["4403387371533", "4403388286093"];

    varnewIds= ["17697696633997", "4403392789005"];

    for (vari=0; i
    if (window.location.href.indexOf(oldIds[i]) >-1) {

    window.location.href=

    "https://support.neofinancial.com/hc/en-ca/articles/"+newIds[i];

    }

    }
    0
  • Spencer Fleury

    Hello—I've had success with this workaround on the article level, but is there any way to make it work for anchor links? As our Help Center grows and evolves, the internal structure of the articles will often change, and headers (which have those anchors) will be deleted or moved to other articles, etc. But there are still links out there in the wild that point to these anchored links, and I'd like to be able to ensure they are redirected to where they need to be.

    (Also, why is this so challenging in Guide? Every other CMS I've worked with supports redirects a lot more efficiently than this. Are there plans to enhance this?)

    0
  • Philip Addison

    Does this process work for archived articles as well, or only for deleted articles?

    0
  • Elizabeth Brown

    Hi Zendesk team - does this option work with archived articles at all? or do I have to delete an article before I can go through the process of redirecting the URL?

    I'd prefer archiving, just in case I want to re-work content later.

    Please advise?

    Cheers

    E.A. Brown

    0
  • Ani

    HiElizabeth BrownandPhilip Addison,

    While you are waiting for Zendesk team to respond, I can share my experience here. For me, the code only worked when I archived the old articles. "Unpublishing" the old article led to a redirect to an authentication page and not to the new article.

    I haven't tried deleting an article and redirecting it yet, so cannot comment on this part.

    Best,

    Ani

    0

Pleasesign into leave a comment.

Powered by Zendesk