dispatch.xml reference

The dispatch.xml allows you to override the routing rules. You can use the dispatch.xml to send incoming requests to a specific service (formerly known as modules) based on the path or hostname in the URL. For example, if you wanted to route requests to the http://simple-sample.appspot.com/mobile/ URL to a mobile front end, and serve all your static content from the default service.

Deploying the dispatch configuration file

The dispatch.xml file should reside in the WEB-INF directory of the default service.

To deploy the dispatch configuration file without otherwise altering the currently serving version, use the command:

appcfg.sh update_dispatch <application directory>

replacing <application directory> with the path to your application main directory.

Deleting all dispatch rules

To delete all dispatch rules:

  1. Edit the contents of the dispatch.xml file to:

    <?xml version="1.0" encoding="UTF-8"?>

  2. Deploy the dispatch.xml file to App Engine.


<?xml version="1.0" encoding="UTF-8"?>
      <!-- Default module serves the typical web resources and all static resources. -->
      <!-- Default module serves simple hostname request. -->
      <!-- Send all mobile traffic to the mobile frontend. -->
      <!-- Send all work to the one static backend. -->


The root element in the dispatch.xml file is <dispatch-entries> and each entry is a <dispatch> element that contain the following elements. .
Element Description

Specifies the name of the service that will handle the requests that match the <url> pattern. Note that services were previously called modules.


A URL pattern that can include the hostname and URL path. Glob characters can be used to match patterns. The Glob characters can be specified only at the beginning of the pattern and end of the pattern.

Note that dispatch rules also apply to URLs that are used in cron configuration or in task queue configuration.

URL paths that begin with /_ah/ are not routed by the dispatch file.


The dispatch file can contain up to 20 routing rules. When specifying the URL string, neither the hostname nor the path can be longer than 100 characters.

Was this page helpful? Let us know how we did:

Send feedback about...

App Engine standard environment for Java