Smart IT / MyIT - how to redirect to MyIT or Smart IT based on URL used to connect to MyIT/SmartIT Tomcat

Version 2
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    Remedy with Smart IT


    Any MyIT/Smart IT version


    Customer has configured their name resolution so that they can connect to Smart IT or MyIT using the following URLs:-  ----> opens Smart IT     ----> opens MyIT

    If we ping and, they both resolve to the same IP Address.

    Now, customer wants to no longer supply the /ux/smart-it or /ux/myitapp paths in their URLs - they require the following to work:-     ---------> opens Smart IT         ---------> opens MyIT



    The following allows us to redirect to Smart IT or MyIT based on the URL (with no path) provided:-

    1). Stop the SmartIT/MyIT Tomcat
    2). Create a directory called ROOT under the <SmartIT/MyIT_Install_Dir>\webapps directory
    3). Create an 'index.html' file in this directory with the following contents:-

    <!DOCTYPE html>
    <html lang="en">
                       if (document.URL == "") {
                              location.href = "";
                       }else if (document.URL == "") {
                              location.href = "";
                                                    document.write("<p> Invalid URL: " + document.URL + "</p>");

    4). Restart the SmartIT/MyIT Tomcat

    NOTE: The default port when using HTTPS will be 443. This was the 'Connector port' value in the SmartIT/MyIT Tomcat 'server.xml' file in this case. This is why the customer did not have to specify a port number in their URLs.
    If a customer was using HTTP rather than HTTPS then the 'Connector port' in SmartIT/MyIT Tomcat 'server.xml' would need to be port 80.

    Also, customers may wish to do something different if the URL does not match the expected one for Smart IT or MyIT in the 'else' section above. This could be a redirection to another URL, some home page etc.

    NOTE: This directory [<SmartIT/MyIT_Install_Dir>\webapps\ROOT] and file: "index.html" are not there by default. This is something which would have been added as an additional customization. If this was added, this would have been done manually as a "re-direct" type of operation. If this directory and file do not exist, that is fine and this does not need to be added unless this type of re-direct is required by the customer.

    Article Number:


    Article Type:


      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles