Re: Trailing slashes in request

2002-11-19 Thread Geoff Howard
The pattern you have below should work - is it
possible you have a typo or some other problem causing
the 404?

In any case, you'll probably want to use the regex
matcher instead of the plain wildcard matcher.  I
don't think it's defined by default in the sitemap so
you may need to add 
map:matcher logger=sitemap.matcher.regexp
name=regexp
src=org.apache.cocoon.matching.RegexpURIMatcher/

to your map:matchers section.

Then, you can just do something like

map:match type=regexp pattern=admin/?
...

HTH, 
Geoff Howard

--- Matthias Brunner [EMAIL PROTECTED] wrote:
 Hello,
 
 someone must have encountered this problem as well
 but I did not find 
 anything useful (at least for me) in the archives.
 
 Sub-sitemap fragment:
 ---
 map:match pattern=admin
   map:redirect-to uri=admin/index/
 /map:match
 map:match pattern=admin/
   map:redirect-to uri=admin/index/
 /map:match
 map:match pattern=admin/index
   map:generate src=admin/index.xml/
   map:transform src=res/xsl/menu2html.xsl/
   map:serialize/
 /map:match 
 ---
 
 So when someone hits
 http://mysite/cocoon/sub/admin; he is 
 redirected to the index page as expected.
 But how do I get http://mysite/cocoon/sub/admin/;
 to work as well? 
 At the moment cocoon returns a 404 error.
 
 And is there a way to define this redirect for all
 requests which did 
 not match elsewhere?
 Something like map:match pattern=.*|.*/
 type=regexp at the end 
 of the pipeline?
 -- 
 Matthias Brunner [EMAIL PROTECTED]
 PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89
 D501
 Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc
 
 

-
 Please check that your question  has not already
 been answered in the
 FAQ before posting.
 http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:  
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: Trailing slashes in request

2002-11-19 Thread Geoff Howard
oops - the regular expression match I gave you can
obviously cause problems because it's not restrictive
enough.  In a similar case, I use: map:match
type=regexp pattern=^admin[/]?$... the brackets
don't have a functional purpose in this case - I just
find it easier to read that way.

Geoff

--- Geoff Howard [EMAIL PROTECTED] wrote:
 The pattern you have below should work - is it
 possible you have a typo or some other problem
 causing
 the 404?
 
 In any case, you'll probably want to use the regex
 matcher instead of the plain wildcard matcher.  I
 don't think it's defined by default in the sitemap
 so
 you may need to add 
 map:matcher logger=sitemap.matcher.regexp
 name=regexp
 src=org.apache.cocoon.matching.RegexpURIMatcher/
 
 to your map:matchers section.
 
 Then, you can just do something like
 
 map:match type=regexp pattern=admin/?
 ...
 
 HTH, 
 Geoff Howard
 
 --- Matthias Brunner [EMAIL PROTECTED]
 wrote:
  Hello,
  
  someone must have encountered this problem as well
  but I did not find 
  anything useful (at least for me) in the archives.
  
  Sub-sitemap fragment:
  ---
  map:match pattern=admin
  map:redirect-to uri=admin/index/
  /map:match
  map:match pattern=admin/
  map:redirect-to uri=admin/index/
  /map:match
  map:match pattern=admin/index
  map:generate src=admin/index.xml/
  map:transform src=res/xsl/menu2html.xsl/
  map:serialize/
  /map:match 
  ---
  
  So when someone hits
  http://mysite/cocoon/sub/admin; he is 
  redirected to the index page as expected.
  But how do I get http://mysite/cocoon/sub/admin/;
  to work as well? 
  At the moment cocoon returns a 404 error.
  
  And is there a way to define this redirect for all
  requests which did 
  not match elsewhere?
  Something like map:match pattern=.*|.*/
  type=regexp at the end 
  of the pipeline?
  -- 
  Matthias Brunner [EMAIL PROTECTED]
  PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB
 5B89
  D501
  Check out
 http://blumenstrasse.vol.at/~mb/gpgkey.asc
  
  
 

-
  Please check that your question  has not already
  been answered in the
  FAQ before posting.
  http://xml.apache.org/cocoon/faq/index.html
  
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:  
  [EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Web Hosting - Let the expert host your site
 http://webhosting.yahoo.com
 

-
 Please check that your question  has not already
 been answered in the
 FAQ before posting.
 http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:  
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: Trailing slashes in request

2002-11-19 Thread Matthias Brunner
On Tuesday 19 November 2002 14:48, Geoff Howard wrote:
 oops - the regular expression match I gave you can
 obviously cause problems because it's not restrictive
 enough.  In a similar case, I use: map:match
 type=regexp pattern=^admin[/]?$... the brackets
 don't have a functional purpose in this case - I just
 find it easier to read that way.

I have just found out that I have been mounting the sub-sitemap below 
the **/ pattern which invokes the DirectoryGenerator :) Corrected 
this.

Unfortunately the following does not even work now:
map:match pattern=^admin[/]?$ type=regexp
map:redirect-to uri=admin/index/
/map:match

http://mysite/cocoon/sub/admin does work but 
http://mysite/cocoon/sub/admin/ is redirected to 
http://mysite/cocoon/sub/admin/admin/index.

Yet these are problems I can solve myself. Again, thank you.
-- 
Matthias Brunner [EMAIL PROTECTED]
PGP FP 7862 32B3 3B75 292A F76F  5042 8587 21AB 5B89 D501
Check out http://blumenstrasse.vol.at/~mb/gpgkey.asc


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]