Redirecting traffic from deleted Help Center articles

Return to top
Have more questions? Submit a request

62 Comments

  • Ehsan Mafi

    +1

    When deleting or unpublishing an article, it would be awesome if you could specify right then & there the new article that you want to redirect the old link to.

    6
  • Joe Fedric

    Really?!

    Give us normal 30x redirect facilities for articles.  How hard can that be?  We're using two Help Centers, and I have to maintain two separate JS redirect banks on my HCs.  Also, your JS code here is pretty bad.  It doesn't allow for easy maintenance of the records you're updating, without refactoring it, because you have to try to match the redirects in the list in a 1:1 fashion.  I had a developer at my company see what you had offered, and how upsetting maintaining just a dozen redirects turned into (bad, bad, bad jumble).  In fact, here's the refactored code:

    //Use this for same domain redirects
    var one = {
    "Old ID 1" : "New ID 1", //Help Center 1, Old Article 1 to New Article 1
    "Old ID 2" : "New ID 2", //Help Center 1, Old Article 2 to New Article 2
    "Old ID 3" : "New ID 3", //Help Center 1, Old Article 3 to New Article 3
    "Old ID 4" : "New ID 4" //Help Center 1, Old Article 4 to New Article 4
    };
    //Use this for different domain redirects (multiple HCs)
    var two = {
    "Old ID 1" : "New ID 1", //Help Center 2, Old Article 1 to New Article 1
    "Old ID 2" : "New ID 2", //Help Center 2, Old Article 2 to New Article 2
    "Old ID 3" : "New ID 3", //Help Center 2, Old Article 3 to New Article 3
    "Old ID 4" : "New ID 4" //Help Center 2, Old Article 4 to New Article 4
    };
    //Loops for redirects
    for (var keytwo in two){
    if (window.location.href.indexOf(keytwo) > -1){
    window.location.href='http://your-first.domain.com/hc/en-us/articles/' + two[keytwo];
    }
    };
    for (var keyone in one){
    if (window.location.href.indexOf(keyone) > -1){
    window.location.href = 'https://your-second.domain.com/hc/en-us/articles/' + one[keyone];
    }
    };

    Provide a real facility for doing this.  Redirects are a huge part of how Zendesk works, and the fact that it's not included in the feature suite, and that you've asked us to abandon this thread for the feedback forums, where there is no thread on this topic (I searched 25 pages before I couldn't take it anymore) -- I am utterly stunned that you're claiming this is too difficult to follow.

    Perhaps you should put a product architect, instead of a product manager, on this problem.  The fact that the article was published over 2 years ago, with the JS code to work around the redirect problem we have with this system, is inexcusable.  It just needs to be fixed.  An explanation is not necessary.  A solution is, however.  Don't even get me started on how hard it is to pull a list of all tags out for reporting.  Some of the basic functions that ZD excludes makes for some serious sore spots, and that they've been unaddressed through a re-brand (over 14 months ago, btw), and are now being pushed around communities, baffles me.

    I also noticed that you've deleted most of the comments in this thread, several of them belonging to me.  This problem has been around FOREVER, and was addressed with this article beginning in 2014.  I've saved this answer so I can repost it, should your delete finger get "itchy".

    6
  • Nan Yu

    Hey @vladen, @nicole / product managers at Zendesk. It's pretty disappointing that you don't offer basic 301 redirect functionality and we have to resort to JS hacks to make this work.

    Issues like this make it seem like our business is not something you're interested in keeping in the long run.

    3
  • Stephen

    Is there a non-Javascript method to control redirected traffic? Javascript assumes that users have JS enabled. This also doesn't seem very scalable to manage content long-term, because we have limited ability to see the redirects, for control and for analytics.

    3
  • Stephen

    "Product Managers are finding it too difficult to follow all of the feedback coming in on article comments." So you expect us, your customer, to sift through 121 pages of feedback points to submit our own comments? How about making it easy for us to be customers and to give feedback, and Zendesk taking the responsibility for cultivating our comments in a way that works for everyone? 

    3
  • Brooke Wayne

    Hey, wondering for an update on this! It's 2018, and we're hitting a lot of roadblocks where deleted links are becoming more costly for our product. 

    Would love to see a solution to set up redirect links for deleted articles - that doesn't involve Javascript. 

    2
  • Simon Celen

    Hi Aswin,

    I see what's going on, the code should only run on dom ready:


    $(document).ready(function () {
    /* Start of redirecting untranslated articles to English */
    var notDefaultLanguage = window.location.href.indexOf('/en-us/') == -1;
    var isArticle = window.location.href.indexOf('/articles/') > -1;
    var isErrorPage = $("#error-page").length > 0;

    if (isArticle && notDefaultLanguage && isErrorPage) {
    var newURL = window.location.href.replace(/(.*\/hc\/)([\w-]+)(\/.*)/, "$1en-us$3");
    window.location.href = newURL;
    }
    /* End of redirecting untranslated articles to English */

    //Up Arrow
    // browser window scroll (in pixels) after which the "back to top" link is shown

    ... snip ...

    That should do it.

     

    Simon

    1
  • Steve Graham

    I put in some redirects and it doesn't work on a phone - the "?mobile_site=true" parameter seems to cause a problem, although I'm not sure why.  I've tested it other ways and it works fine, even with dummy content after the ID or "?asdfads=asdfasdfasd" and it redirects.  But for some reason with "?mobile_site=true" it doesn't redirect.

    1
  • Brooke Wayne

    I would like to second Stephen's point above - a non-JS method would be greatly appreciated! 

    1
  • Eugenia Pavlovskaya

    Hi,

    I'm trying to redirect non-existent articles to our main page, but our JS file doesn't have that line:

    $(document).ready(function() {

    While we do have a custom theme, it is based on Copenhagen and I have just checked JS file in Copenhagen and didn't manage to find it there either. I tried using different combinations, even looking for all mentions of "document", yet nothing similar seem to be present in neither in Copenhagen nor in our custom theme...

    1
  • Scott

    There is an error in the following line:

    if ( isArticle && notDefaultLaugage && isErrorPage ) {

    Should be notDefaultLanguage.

     

    1
  • Brooke Wayne

    @stephen @joe: If it helps, I found a page in the Community that fits the topic and just copied + pasted my comment from above there.

    For what it's worth, I'm in complete agreement with both of your comments too.

    1
  • Kay
    Community Moderator

    Hi David,

    For a hostmapped domain (example: cocacola.com/help) you can set-up a 301 Redirect via a .htaccess file.

    Using the .htaccess method won't impact your SEO. The JS redirect might have impact on your SEO.
    From an SEO point of view, a JavaScript redirect is not the most optimal way of redirecting because search engines need to render a page to find the redirectRedirecting using a 301 redirect is always recommended (except if you're looking to temporarily redirect)

    Articles still have the same ID
    If your articles still have the same ID, then you need 1 redirect line.

    Articles with changed IDs
    You will need a single redirect line for each article if your articles no longer have the same article ID.
    1
  • Alejandro Colon

    Thanks, Elliott,

    I used your redirect idea to set up article redirects to simulate an article being in multiple sections without having to duplicate the content.

    How to Include Article in Multiple Sections

    1
  • David A.

    Hi,

    How do I redirect a knowledgebase article to an external URL?

    In this case, the URLs are on our company website.

    0
  • Nicole S.
    Zendesk Community Team

    Hey Stephen - 

    We're trying to simplify it by keeping all of the conversations in the Product Feedback threads. You can do a quick search to see if there's a thread relevant to your feedback and if not, create a new post. 

    We're trying very hard to cultivate your comments in a way that works for everyone, and that may be reflected in new processes or a different means of collecting feedback altogether in the future. For the moment, we are trying to focus things in the Product Feedback topic. 

     

    0
  • Brett Bowser
    Zendesk Community Team

    Hi Monica,

    As far as I know, when an anonymous user attempts to access an article they do not have access to, they will automatically be directed to the login page.

    I'm not exactly sure how you would go about redirecting them to a page they do have access to other than using custom code.

    I'll leave this post open in case other users want to jump in and offer up advice on how to set this up on your end.

    I'll also reach out to our Zendesk Moderators to see if they have any guidance.

    Cheers!

    0
  • Simon Celen

    Hi Aswin,

    Could you link me to your sandbox so I can take a look? Thanks

    0
  • Vladan Jovic
    Community Moderator

    Hey Kelly, glad you've sorted it out!

    Also, thanks for sharing your code, it looks great!

     

    0
  • Aswin Kannan

    Hello everyone - Has anyone figured out how to use vanity URLs in Help Center/Guide?

    Ex: help.company.com/offers linking to an article like https://help.company.com/hc/en-us/articles/360081928433-Latest-offers-and-promotions

    Zendesk makes it really difficult to maintain redirects and we have a necessity to create a bunch of these vanity URLs. :(

    0
  • Nicole S.
    Zendesk Community Team

    Hi Eric, 

    You nailed it with your second question - that page appears and then the JS runs to execute the redirect. At the moment we do not have a workaround to offer. 

    That being said, you may want to post your issue and what you're looking for in the Guide product feedback forum. You may also want to comment or up-vote on this request: Allow Redirect of URLs 

    0
  • Merav B

    Thanks for pointing on that error! It works for me now.

     

    0
  • Aswin Kannan

    Thank you, Simon. We are using a customized theme built on top of Copenhagen. Our help center is help.cricut.com.

    0
  • Aswin Kannan

    Hi all - I'm trying to use the script for "Redirecting untranslated articles to an existing language", but it doesn't seem to work. I still get the error page instead of being redirected. Has anyone had success?

    Is it because the code has error-page but the template is error_page.hbs? I swapped the hyphen with an underscore and it doesn't make a difference.

    var isErrorPage = $(".error-page").length > 0;
    
    0
  • uncle_joe

    Exactly as another user has written, 

    I'm trying to redirect non-existent articles to our main page, but our JS file doesn't have that line:

    $(document).ready(function() {

    While we do have a custom theme, it is based on Copenhagen and I have just checked JS file in Copenhagen and didn't manage to find it there either. I tried using different combinations, even looking for all mentions of "document", yet nothing similar seem to be present in neither in Copenhagen nor in our custom theme...

    So how can we add the code to our JS file? It's throwing an error on this line:

    `var isErrorPage = $(".error-page").length > 0;`

    With the $ being the culprit.

    0
  • David Halewood

    Hi Devan - Community Manager, thanks, would the above solution work across brands, it should from what I've seen but I wonder how SEO might be impacted. We are keen to retain relevance whilst redirecting to our new brand.  Any help from the moderator team would be greatly appreciated.

    0
  • Kelly Sofia

    Is there a way to do this with deleted sections (instead of articles) - we've shifted articles from a discontinued section. 

    0
  • Jean Cesar Martínez

    Hi -

    We support two languages for most of our articles. For the ones we don't we to redirect the user to the same article in the existing language.

    I tried the Redirecting untranslated articles to an existing language section in this article, but:

    I dont see the document.ready function in our helpcenter code so I thought that I had to insert the whole function. I found a spot in the script.js file and put it there. It didn't work. Instead of redirecting to the article with the existing language, is redirecting to the main page.

    Even without the code I inserted, the helpcenter is redirecting to the main page.

    What am I missing?

    I really want to avoid creating the same article in the unsupported language... 

    0
  • Aswin Kannan

    Simon - Our sandbox has different themes under construction, so it will be messy. But the change that you have suggested is available in our production now (help.cricut.com). Feel free to take a look again. Thanks a bunch for your help! :)

    0

Please sign in to leave a comment.

Powered by Zendesk