Configuring aliases for image locations

You can create an alias for an image or image location (on disk or on the Web). End users can then refer to the alias instead of to the actual location when they construct an image transformation URL. This not only makes life easier for your end users, it also allows you to change the locations of images without forcing your users to rewrite their URLs.

Procedure

  1. Navigate to the WEB-INF/classes/ (Java) or to the bin\config\ (.NET) subdirectory of your Web application.
  2. Open cwd_engine_conf.xml for editing.
  3. Ensure that the <context> section contains an <image> section that contains a <sources> section.
  4. Within the <sources> section, create a <urls> section.
  5. Within the <urls> section, create one or more child elements. Each child element must have a unique tag name and contain a URL or local path. Either of these two can refer to a location or to a specific image file. For example, the <urls> section could look as follows:
    <urls>
      <stock>http://www.example.com/images</stock>
      <local>file:///C:/workspaces/images</local>
      <logo>file:///C:/workspaces/images/corporate/logo.jpg</logo>
    </urls>
  6. Save and close cwd_engine_conf.xml and restart the Web application to apply your changes.
  7. Communicate the aliases you have created, and what they represent.

Results

Users who construct an image transformation URL can now use /source/ALIAS (where ALIAS is the tag name of an alias you constructed) in that URL. The URL will be processed as if the user had typed the value of ALIAS.