cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring URL redirection for ThingWorx

Opal

Configuring URL redirection for ThingWorx

To maintain a cleaner look of your ThingWorx server access URL, whether for production or convenience reasons, you may look into setting up redirection.

This is a quick example on how to redirect <your.main.url.com> to <your.main.url.com/Thingworx>

Go to the /<apache-tomcat-directory>/webapps/ROOT/ and find the "index.jsp" file. Copy that file for backup purposes and replace with a new one, containing the following:


<!DOCTYPE html>
<html>
<head>
<title>Redirecting....</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"> 
        function Redirect() { 
              window.location="/Thingworx/";
        }
        setTimeout('Redirect()', 0); 
</script>
</head>

Please note that once the URL is hit, it will still append the rest of the /Thingworx query in the address bar (i.e keep the "redirected to" address).

You may also utilize this to have your <main.url.com> redirect to one of the mashups. This was the user, with proper permissions in place, may access the mashup directly, bypassing the Composer.

Tags (1)
4 REPLIES 4

Re: Configuring URL redirection for ThingWorx

Hi Polina,

When using this (or another re-direct) it causes the first authentication attempt to always fail.

The second attempt will work.

This is a bad user experience, do you know why this is happening?

Re: Configuring URL redirection for ThingWorx

did you find another solution?

Re: Configuring URL redirection for ThingWorx

You just need to change the extension of this file to "html" instead of using a "jsp" file. That will avoid the double authentication!

 

In conf/web.xml, you will see at the bottom of the file, there is a list of welcome files. The order is important and the html is searched first. So you can keep the OOTB jsp file, and create an html file that is in charge of the re-routing actions.

 

Note the content referenced above works. FYI you can also use the content referenced in the PTC CS165279. However, in this solution, you will have to update the file with the right server name each time you deploy it to a different server (DEV, Staging... Prod).

Re: Configuring URL redirection for ThingWorx

This is happening because you use a jsp page... with the "html" extension, you don't have any double authentication. Please see the solution/explanation in another reply of this page.