Using URL rewrite to "change domain" and hide ugly links RRS feed

  • Question

  • User-1709139051 posted


    I have the following situation:

    • We have an application that publishes dashboards, which produces very long, very ugly links (example: http:// server. domain/ibmcognos/bi/?pathRef=.public_folders%2FAM%2BStuurt%2521%2FBeheerde%2Bproducten%2FDBAM%2FRapporten%2FDashboard%2Bassetmanagement

    There is a (different) server with IIS, on which we have folders in the wwwroot folder, to make them accessible by shortcuts (for the above example, http://123.a.b.nl/DBAM is the shortcut) (not really, just not so keen on giving out the domain name).

    In the DBAM folder there is an index.htm and web.config file.

    We used to use iframes to load up the page mentioned above, but some of the functionality isn't working (popups not showing). 

    Now I'm trying to redirect users to the correct URL (long and ugly) but make their browser display the "clean" URL. 

    I'm doing this with a <meta http-equiv="refresh"> tag in index.htm. 

    the dashboard gets loaded correctly after the meta http refresh, displaying the ugly url, all functionality is enabled. 

    My question: How would one go about making sure the user does not see the "ugly" links? 

    It's my understanding that IIS URL REWRITE is applied before the refresh, so useless afterwards. 

    Please enlighten me. 

    PS, my title is this way, because the idea is to change the ugly url from one server (http://serverA*****) to (http://server2****

    Friday, June 28, 2019 11:37 AM

All replies

  • User690216013 posted

    Now I'm trying to redirect users to the correct URL (long and ugly) but make their browser display the "clean" URL. 

    That's completely wrong. Use both inbound and outbound rules to clean up the URLs, and that's enough.

    Friday, June 28, 2019 2:06 PM
  • User-1709139051 posted

    Could you maybe elaborate with an example of how to configure this?

    I'm not really an IIS guru as you might've already guessed.

    Monday, July 1, 2019 6:37 AM
  • User-2106141979 posted

    UrlRewrite does not have a lot to work with, only the url and query string you provide it, so the iframe solution might be unavoidable if there are lots of dashboards or if the dashboards need their urls to be heavily customized.

    The best you can do with a pure UrlRewrite solution would be to create neat form url's that contain all the information required to rebuild the ugly form url. Depending on how many reports there are, this might just entail "lots" of UrlRewrite rules

    i.e. You could create rules on your ARR server that would remap urls like "https://reports.example.com/assets/DBAM" to links like the above using something similar to this:

    A match pattern (regex) of "^assets/(.*)"

    A condition that {HTTP_HOST} matches "^reports(?:\.example\.com)"

    and a Rewrite rule with a Url: "http://server. domain/ibmcognos/bi/?pathRef=.public_folders%2FAM%2BStuurt%2521%2FBeheerde%2Bproducten%2F{R:1}%2FRapporten%2FDashboard%2Bassetmanagement"

    And of course, stop processing any more rules.

    Repeat for every other dashboard.

    Saturday, July 6, 2019 5:33 AM