Customer Portal

Get Involved. Join the Conversation.

Topic

    DustinTuft
    KB article URL links in CPAnswered
    Topic posted October 29, 2008 by DustinTuft Bronze Medal: 1,250+ Points, last edited October 29, 2011 
    2303 Views, 15 Comments
    Title:
    KB article URL links in CP
    Content:

    Has any one used a shorten URL for KB articles?

     

    Today we use a PHP script on our RNT poratal to interpet the URL and then based on if faq=*** then redirect to that article. We have lots of doc's that refrance our KB with this type of URL http://support.pgp.com/?faq=589. If you click that link you will see our DNS pass the URL of to RNT, then the portal takes over and places the enduser on the requested article.

     

    How do I retain this URL format in CP as this could be a problem for us to change all of our doc's?

     

    This also brings up a question on our forum as well, lots of forum posts have KB links in them as well, and most are full path to the old format for displaying a KB article. Has any one been able to over come this problem?

     

    I almost have to retain a redirecting PHP file in what will be the old file paths to ensure that we don't have any broken links causing problems.

     

    Thanks

    Best Comment

    DustinTuft

    I know some one else was following this thread, if they still are, there is a CP solution to redirecting based on the URL. I am posting the solution from RNT tech support. Remember that you will need to alter the code to fit your needs, but once you read the code it's really quite cleaver. This may of course not fit for every one, so be sure to test it on your dev as I did before production!!

     

    Response (Scott Cahill) 06/08/2009 12:33 PM Dustin, After some further testing it look like we have a workable solution. Because of CP is setup, the redirects that may have worked before will not work now. To fix the issue please edit the following: /euf/development/errors/error_404.php At the very start of the script before the header("HTTP/1.1 404 Not Found"); add the following: if ($_GET['faq'] > 1) { header('location: /app/answers/detail/a_id/'.$_GET['faq']); exit; } Once this is deployed it should fix your redirect issue. Please let me know if you have any other questions or if I can be any further assistance. Thanks. Scott Cahill Tier 2 Customer Care Specialist RightNow Technologies, Inc.

     

    Comment

     

    • Leif Wickland
      Dustin,

      Customer Portal has redirection of requests for old end user pages to the new equivalent built in. It is enabled once you have deployed CP successfully. It looks like you've not deployed CP on your pgp--upgrade.custhelp.com site. When you do, requests for https://pgp--upgrade.custhelp.com/cgi-bin/pgp.cfg/php/enduser/std_adp.php?p_faqid=589 should be redirected to the equivalent CP page, https://pgp--upgrade.custhelp.com/app/answers/detail/a_id/589.

      I believe that your existing "?faq=***" redirect will continue to work because it will redirect to the old enduser pages which will redirect to the new CP pages.

      Will this solution work for you?

      Thanks,

      Leif
    • DustinTuft

      Hi Leif,

       

      We currently make this happen with the following code snip

       

      if ($HTTP_GET_VARS['gotopage'] != "" ) { $pgp_goto_redirect = $HTTP_GET_VARS['gotopage']; http_redirect($pgp_goto_redirect); } else { if ( $HTTP_GET_VARS['faq'] != "" ) { $pgp_faq_redirect = "std_adp.php?p_faqid=" . $HTTP_GET_VARS['faq'] . "&p_topview=1"; http_redirect($pgp_faq_redirect);

       

      As you can see we have a couple of quick page functions. Do you mean to say that entry.php will remain in place after deploying CP?

       

      Thanks

    • erich hannan

      entry.php does remain in place after you deploy CP, as well as other files in scripts/enduser/.  But during the initialization of the script (init.phph) we look to see if CP is deployed and then use a configuration file to redirect from old locations in Classic pages to new locations in CP pages.  This is to insure that external links and links in old email responses still redirect folks to the right place.

       

    • DustinTuft

      Hi MTcoug,

       

      That is great, so it is possible to intercept our web calls and ensure that they get directed to the correct place. That is great news, almost like early christmas :smileyvery-happy:

       

      Thanks for the confirming that!!!!

    • kathyj
      Does this work in the August 08 version of CP?
    • Ernie Turner
      Yes this will work in the August '08 version. You can configure where old enduser requests are redirected to by editing the /euf/config/url_mappings.txt file through WebDAV.
    • kathyj
      this is great news...your support team told me it would not work!!
    • amy ferguson

      Can clarify what you mean by "...old enduser requests are redirected"?

       

      Customer has hard coded urls on their site that link to RN site feedback, ask, and a custom form.  Can you confirm that they can edit the url_mappings.txt file to redirect these links so that they do not have to change the urls on their site?

    • Ernie Turner

      Correct, they will not have to change the URL's on their site. Whenever a link is followed to an old enduser URL, if there is an entry in the url_mappings.txt file, the request will be redirected. If there is no mapping for the request that was made, then the user will just be redirected to the Customer Portal home page.

       

      Ideally the customer should update their URL's. The url_mappings.txt file will work in the meantime, but it would be a better long term approach for them to link to the correct place.

    • DustinTuft

      So we have finaly deployed CP, but I am having a problem with the faq redirect. It's like the code is not getting ran. I have the following lines in the top of my entry.php file, but for what ever reason I don't think it's ever getting called.

       

      if($HTTP_GET_VARS['faq'] != '') { header('Location https://pgp.custhelp.com/app/answers/detail/a_id/' . $HTTP_GET_VARS['faq']); exit; }

       

       

      Any ideas? it's causing a 404 error for all of our shorten KB links such as https://support.pgp.com/?faq=18

       

      Thanks

       

      Dustin T

    • Ernie Turner
      You don't want to put your redirects in the entry.php file. Within Customer Portal, you want to edit either the /config/url_mappings.txt (8.8) or /development/config/mapping.php (8.11+) file to perform your redirects. By default, there should already be an entry for the answer detail page, so I don't think you should need to add your own.
    • DustinTuft

      Please take a look at the error, CP is looking for Page ?faq=18.php.

       

      I can't possibly put an entry in for every article we have. I need to be able to intercept this call and redirect it manualy. I try using hooks, but there is not a hook, or at least a published hook that excuts before the entire site is ran.

       

      THe closest hock I could find was pre_page_render, but if I understand that one correctly, a page has to exist and be ran before the hook is called.

       

      Thanks

    • Leif Wickland
      Dustin,

      You're right and we were wrong. The standard Customer Portal redirection won't work for you because your custom shortened URLs don't attempt to access a classic page; instead you were taking advantage of the redirection from pgp.custhelp.com/ to the classic home page and the redirecting when that code ran.

      Exactly as you say, the CP code isn't going to give you a chance to send the request to the right place.

      I think the best course for you to pursue at this point is to contact customer support and ask for a change to your site's apache configuration to redirect or rewrite requests like /\?faq=(\d+)\.php to /app/answers/detail/a_id/$1
    • DustinTuft

      I know some one else was following this thread, if they still are, there is a CP solution to redirecting based on the URL. I am posting the solution from RNT tech support. Remember that you will need to alter the code to fit your needs, but once you read the code it's really quite cleaver. This may of course not fit for every one, so be sure to test it on your dev as I did before production!!

       

      Response (Scott Cahill) 06/08/2009 12:33 PM Dustin, After some further testing it look like we have a workable solution. Because of CP is setup, the redirects that may have worked before will not work now. To fix the issue please edit the following: /euf/development/errors/error_404.php At the very start of the script before the header("HTTP/1.1 404 Not Found"); add the following: if ($_GET['faq'] > 1) { header('location: /app/answers/detail/a_id/'.$_GET['faq']); exit; } Once this is deployed it should fix your redirect issue. Please let me know if you have any other questions or if I can be any further assistance. Thanks. Scott Cahill Tier 2 Customer Care Specialist RightNow Technologies, Inc.

       

    • Leif Wickland
      That's a clever solution, which Scott should be commended for.