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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Shortening a mashup url?

ague
13-Aquamarine

Shortening a mashup url?

Anyone know how to shorten a mashup's URL in ThingWorx? I already have a page that lives at 'www.myserver.com/Thingworx/Home', so I need another address that will read 'www.myserver.com/Thingworx/Home/MyPageName'.

 

I've found this article already re using a Google API to shorten a URL: https://support.ptc.com/help/thingworx_apps/r8.5/en/index.html#page/thingworx_apps/ThingWorxAppsSetupConfig/url_shortening_service.html.

 

However, the second step of this article seems to indicate the use of Manufacturing Apps, which I am not using. 

ACCEPTED SOLUTION

Accepted Solutions
BennyB
16-Pearl
(To:ague)

Since this is no clear reply here a short description.

 

  1. Open file D:\Apache Software Foundation\Tomcat 8.5\conf\server.xml (of course adjust path to your installation folder)
    • Find path Server/Service/Engine/Host (probably at the bottom)
    • Add: <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
  2. Create file rewrite.config in path D:\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost

 

Example rewrite.config:

RewriteRule ^/Common/(.*) /Thingworx/Common/$1 [L]
RewriteRule ^/DSP/(.*) /Thingworx/$1 [L]
RewriteRule ^/DSPR/(.*) /Thingworx/Runtime/$1 [L]

 

RewriteRule ^/Machine/(.*)$ /Thingworx/Runtime/index.html?mashup=MachineViewMashup&EntityName=$1 [R,L,NE,NC]
RewriteRule ^/Plant /Thingworx/Runtime/index.html?mashup=PlantViewMashup [R,L,NE,NC]

View solution in original post

4 REPLIES 4
BennyB
16-Pearl
(To:ague)

You can use Tomcat redirect mechanism by modifying server.xml and rewrite config. Don't have a full description right now but google may be your friend.

ague
13-Aquamarine
(To:BennyB)

 
BennyB
16-Pearl
(To:ague)

Since this is no clear reply here a short description.

 

  1. Open file D:\Apache Software Foundation\Tomcat 8.5\conf\server.xml (of course adjust path to your installation folder)
    • Find path Server/Service/Engine/Host (probably at the bottom)
    • Add: <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
  2. Create file rewrite.config in path D:\Apache Software Foundation\Tomcat 8.5\conf\Catalina\localhost

 

Example rewrite.config:

RewriteRule ^/Common/(.*) /Thingworx/Common/$1 [L]
RewriteRule ^/DSP/(.*) /Thingworx/$1 [L]
RewriteRule ^/DSPR/(.*) /Thingworx/Runtime/$1 [L]

 

RewriteRule ^/Machine/(.*)$ /Thingworx/Runtime/index.html?mashup=MachineViewMashup&EntityName=$1 [R,L,NE,NC]
RewriteRule ^/Plant /Thingworx/Runtime/index.html?mashup=PlantViewMashup [R,L,NE,NC]

slangley
23-Emerald II
(To:ague)

Hi @ague.

 

If you are satisfied with the previous response, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags