Embedthis Appweb 3.4.0
Home > Users Guide > Configuration Directives > Location Directives

Quick Nav

See Also

Location Directives

AddHandler

Description Add a handler for processing content with specific file extensions
Synopsis AddHandler handlerName extension [extension] ...
Context Default server, Virtual host, Location
Example AddHandler ejs .ejs .asp
Notes

The AddHandler directive ensures that the Appweb handler specified by handlerName, will be run whenever a document with the given extension is requested. Multiple extensions may be specified and multiple AddHandler directives may exist for any handler.

If the AddHandler directive is specified within a VirtualHost or Location block, it is only valid within that context. VirtualHosts and Location blocks inherit the handler settings defined by outer blocks. I.e. a VirtualHost will inherit all the handlers of the default server. If you wish to remove a handler mapping, use ResetPipeline and then re-add the required handlers.

NOTE: Unlike Apache, the extensions are case sensitive on systems that have case sensitive file systems. Also, the period must be part of the extension.

AddInputFilter

Description Add the specified filter to the input processing pipeline
Synopsis AddInputFilter filterName
Context Default server, VirtualHost, Location
Example <Location /secret/>
    AddInputFilter decryptFilter
</Location>
Notes

The AddInputFilter directive adds a filter to the input processing pipeline. Incoming request data is passed through the input pipeline and may be processed by each filter in turn.

Filters stack and thus have an order. The first filter added will receive the data last and the last filter defined for a given URL will be the first filter to receive the data.

AddOutputFilter

Description Add the specified filter to the output processing pipeline
Synopsis AddOutputFilter filterName
Context Default server, VirtualHost, Location
Example <Location /capture/>
    AddOutputFilter compressFilter
</Location>
Notes

The AddOutputFilter directive adds a filter to the output processing pipeline. Output response data is passed through the output pipeline before being sent to the client.

Filters stack and thus have an order. The first filter added will receive the output data first and the last filter defined for a given URL will be the last filter to receive the data before it is passed to the network connector for transmitting to the client.

Location

Description Define a block of directives to apply to a URL
Synopsis <Location URL>
...
</Location>
Context Default server, VirtualHost
Example <Location /admin/debug>
    AddHandler myDebugHandler
</Location>
Notes

The Location directive defines a block of directives that apply to the given URL and all URLs that begin with that URL prefix. Location directives are mainly used to associate Handlers with URLs.

The main difference between the Directory and Location directives is that while the Directory directive applies to files in the file system, the Location directive applies to the URLs before they are mapped to file names.

PutMethod

Description Control use of the HTTP PUT method inside a location block.
Synopsis PutMethod [on|off]
Context Default Server, Virtual host, Location
Example ResetPipeline
Notes

The HTTP PUT method is used for sending content to the server. It can be destructive and so the PUT method is disabled by default. It must be explicitly enabled for a location block efore use.

NOTE: PutMethod is a proprietary Appweb directive.

ResetPipeline

Description Reset the input and output processing pipeline.
Synopsis ResetPipeline
Context Default Server, Virtual host, Location
Example ResetPipeline
Notes

The ResetPipeline directive cancels all previously defined handlers, filters and connectors for the specified context. ResetPipeline will clear both the incoming and outgoing pipeline. Use AddInputFilter, AddoutputFilter, AddHandler and AddConnector to reinitialize the pipeline.

ResetPipeline is most often used inside VirtualHost blocks when you want to limit the pipeline to a small set of handlers and filters for that Virtual Host.

NOTE: ResetPipeline is a proprietary Appweb directive.

SetConnector

Description Set the connector to transmit the response to the client
Synopsis SetConnector connectorName
Context Default server, Virtual host, Location
Example SetConnector netConnector
Notes

The SetConnector directive defines the network connector that will transmit a response to the client. The connector represents the last stage in the output request pipeline.

SetHandler

Description Set the handler to processing requests
Synopsis SetHandler handlerName
Context Default server, Virtual host, Location
Example SetHandler handlerName
Notes

The SetHandler directive defines the request handler that will service a request matching the enclosing block.

© Embedthis Software LLC, 2003-2012. All rights reserved. Embedthis, Ejscript and Appweb are trademarks of Embedthis Software LLC.