Documentation Center

Changing the Application Context URL

Changing the application context allows you to change the application's URL to help Content Delivery fit into your web hierarchy. It can be important to change your site URL to / if you want your site to be indexed by search engines, because many have a verification file that they want you to put into the / folder.

About this task

If you change the URL, you can access Content Delivery by browsing to http://contentdelivery.lc.example.com/ (where lc refers to an example related to Content Delivery, and contentdelivery specifies it further as a delivery server) instead of http://contentdelivery.lc.example.com/ContentDelivery/

By default, the URL you use to access Content Delivery is http://contentdelivery.lc.example.com/ContentDelivery/ In this URL, ContentDelivery is the application context.

To access Content Delivery using a URL that does not have the port number, set the Content Delivery port number to 80, the default HTTP port.

Procedure

  1. For a bundled web app,
    1. Open the ContentDelivery_home/tools/jetty/etc/jetty.xml file.
    2. Edit the Arg element to be the context you want:
      <Call name="addWebApplication">
      	<Arg>/ContentDelivery</Arg>
      	<Arg>
      	<SystemProperty name="exist.home" default="../.."/>/webapp/</Arg>
      	<Set name="defaultsDescriptor">
      	<SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
      	<Set name="displayName">ContentDelivery</Set>
      </Call>
      For example, if you change it to <Arg> /MyApp </Arg>, the URL you use to access Content Delivery http://contentdelivery.lc.example.com/MyApp/. If you do not want a context at all, change the Arg to <Arg>/</Arg> and the URL becomes http://contentdelivery.lc.example.com/
  2. For a third-party web app,
    1. Open the TOMCAT HOME/conf/server.xml file.
    2. Add the following before the </Host> element (before the beginning of the <Engine> element)
         <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">
      
       
      
              <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
      
                     prefix="localhost_access_log." suffix=".txt"
      
                     pattern="%h %l %u %t &quot;%r&quot; %s %b" />
      
       
      
                <!-- This line should be added for removing the context from the URL --> 
      
                <Context path="" docBase="LiveContent" xmlBlockExternal="false"/>
      
       
      
            </Host>
      This makes Content Delivery the default application on the web server.
  3. Stop, and then restart the web server.
  4. Start Content Delivery.
  5. Clear the cache.
    1. In the breadcrumb trail, click Home.
    2. In the Administration Tools pane, click Manage Application.
    3. Click Global Config.
    4. Click Clear Cache.

Results

You can now invoke Content Delivery using www.contentdelivery.lc.example.com (instead of using www.contentdelivery.lc.example.com/ContentDelivery).