[cgiapp] Re: getting C::A::Dispatch to ignore certain URLs

Mark Stosberg mark at summersault.com
Mon Jan 26 22:32:49 EST 2009


On Sat, 24 Jan 2009 21:48:48 -0600
P Kishor <punkish at eidesis.org> wrote:

> The way I have set up my application, the following 3 URLs all result
> in displaying "Target," that is, the 'view' runmode
> 
>   <server>/
>   <server>/Target
>   <server>/view/Target
> 
> I have other runmodes that are like so
> 
>   <server>/edit/Target
>   <server>create/New_Target
> 
> and so on.
> 
> Here is the problem... if a page has a link to a resource that has to
> be displayed directly in the browser, for example, a PDF,
> C::A::Dispatch wants to handle it as well. For example, the following
> URL
> 
>   <server>/img/doc.pdf
> 
> results in an error. How can I make C::A::Dispatch ignore URLs that
> point to anything in the <server>/img/ directory?

The solution you require is provided in the documentation. It is to only send
URLS to your dispatcher if they do not already physically exist. The images
physically exist at the URLS you are using, they would never be given to the
dispatcher.  See here:

http://search.cpan.org/~markstos/CGI-Application-Dispatch-2.15/lib/CGI/Application/Dispatch.pm#Simple_Apache_Example

    Mark

-- 
http://mark.stosberg.com/blog





More information about the cgiapp mailing list