You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nesto <ne...@libero.it> on 2003/04/08 12:08:14 UTC

Redirecting

Hi!
I want to set a simple redirect in my Application, but I can't get it!
My goal is to write the main url of the application as:

http://localhost:8080/cocoon/myApp

while now I have:  http://localhost:8080/cocoon/myApp/index

It's a simple question with a simple answer, as I read on the Wiki, so I
don't know why it doesn't works.
My sitemap is this:

<map:pipelines>
<map:pipeline>
    <map:match pattern="">
        <map:redirect-to resource="index"/>
    </map:match>

<map:match pattern="index">
    <map:generate src="index-page.xml"/>
    ...
</map:match>

....

I tried also to write the tag <map:redirect-to uri="index"/> with the same
result.

If I try these requests:
http://localhost:8080/cocoon/myApp I get a "Resource not found" error. (Of
course the resource exists!)
http://localhost:8080/cocoon/myApp/ I get the directory listing.

Where is the error??

Thank you for all your answers!

Nesto



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Redirecting

Posted by Konstantin Piroumian <kp...@apache.org>.
From: "Nesto" <ne...@libero.it>

> Hi!
> I want to set a simple redirect in my Application, but I can't get it!
> My goal is to write the main url of the application as:
>
> http://localhost:8080/cocoon/myApp
>
> while now I have:  http://localhost:8080/cocoon/myApp/index
>
> It's a simple question with a simple answer, as I read on the Wiki, so I
> don't know why it doesn't works.
> My sitemap is this:
>
> <map:pipelines>
> <map:pipeline>
>     <map:match pattern="">

Try to change this:

>         <map:redirect-to resource="index"/>

into:

<map:redirect-to uri="index"/>

Konstantin

>     </map:match>
>
> <map:match pattern="index">
>     <map:generate src="index-page.xml"/>
>     ...
> </map:match>
>
> ....
>
> I tried also to write the tag <map:redirect-to uri="index"/> with the same
> result.
>
> If I try these requests:
> http://localhost:8080/cocoon/myApp I get a "Resource not found" error. (Of
> course the resource exists!)
> http://localhost:8080/cocoon/myApp/ I get the directory listing.
>
> Where is the error??
>
> Thank you for all your answers!
>
> Nesto
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Redirecting

Posted by Stavros Kounis <go...@osmosis.gr>.

i had the same problem in sub-sitemap

i guest that parent sitemap has a pipeline match pattern that catch your
request

i have change the line position of sub site map entry in parent sitemap
and have solve this problem

hope this help

--stavros

On Tue, 8 Apr 2003, Nesto wrote:

> Hi!
> I want to set a simple redirect in my Application, but I can't get it!
> My goal is to write the main url of the application as:
>
> http://localhost:8080/cocoon/myApp
>
> while now I have:  http://localhost:8080/cocoon/myApp/index
>
> It's a simple question with a simple answer, as I read on the Wiki, so I
> don't know why it doesn't works.
> My sitemap is this:
>
> <map:pipelines>
> <map:pipeline>
>     <map:match pattern="">
>         <map:redirect-to resource="index"/>
>     </map:match>
>
> <map:match pattern="index">
>     <map:generate src="index-page.xml"/>
>     ...
> </map:match>
>
> ....
>
> I tried also to write the tag <map:redirect-to uri="index"/> with the same
> result.
>
> If I try these requests:
> http://localhost:8080/cocoon/myApp I get a "Resource not found" error. (Of
> course the resource exists!)
> http://localhost:8080/cocoon/myApp/ I get the directory listing.
>
> Where is the error??
>
> Thank you for all your answers!
>
> Nesto
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Redirecting

Posted by Upayavira <uv...@upaya.co.uk>.
> I want to set a simple redirect in my Application, but I can't get it!
> My goal is to write the main url of the application as:
> 
> http://localhost:8080/cocoon/myApp
> 
> while now I have:  http://localhost:8080/cocoon/myApp/index
> 
> It's a simple question with a simple answer, as I read on the Wiki, so
> I don't know why it doesn't works. My sitemap is this:
> 
> <map:pipelines>
> <map:pipeline>
>     <map:match pattern="">
>         <map:redirect-to resource="index"/>
>     </map:match>
> 
> <map:match pattern="index">
>     <map:generate src="index-page.xml"/>
>     ...
> </map:match>
> 
> ....
> 
> I tried also to write the tag <map:redirect-to uri="index"/> with the
> same result.
> 
> If I try these requests:
> http://localhost:8080/cocoon/myApp I get a "Resource not found" error.
> (Of course the resource exists!) http://localhost:8080/cocoon/myApp/ I
> get the directory listing.

The redirect you have will allow you to use the URL:

http://localhost:8080/cocoon/myApp/
not
http://localhost:8080/cocoon/myApp

If you want the latter, you should put a redirect in your root sitemap, such as

<map:match pattern="myApp">
  <redirect-to uri="myApp/index"/>
</map:match>

which will be alongside your mount:
<map:match pattern="myApp/**">
  <map:mount src="...." ....../>
</map:match>

Hope that makes sense.

Regards, Upayavira


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org