On 27/12/2022 06:25, Fedor Makarov wrote:
Tomcat 9.0.65
Hello I have some problems with redirects by requests without trailing slashes.
When I try to get to the page for example: "about/page" tomcat understands that it is necessary to add a slash and adds it, however, he also adds the name of the root folder to this, that is, the url "lundase/about/page/" turns out, and any requests to our server via apache are proxied with the addition of "lundase", so it turns out that we are accessing the application on request "lundase/lundase/about/page/" which results in a 404 status.
I googled it and found two properties:
context.setMapperContextRootRedirectEnabled(false)
context.setMapperDirectoryRedirectEnabled(false)
And tryed to play with them, however, it's not resolve my problem please can
you help me with it?
<snip/>
The request "/about/page" (the leading '/' is important) doesn't match
any of the provided servlet mappings:
<url-pattern>/client-error/*</url-pattern>
<url-pattern>/warehouses/*</url-pattern>
<url-pattern>/properties-for-rent/*</url-pattern>
<url-pattern>/about/events/*</url-pattern>
<url-pattern>/ping/*</url-pattern>
<url-pattern>/catalogue/*</url-pattern>
<url-pattern>/binary/*</url-pattern>
<url-pattern>/content/*</url-pattern>
<url-pattern>/lundaprogrammet/*</url-pattern>
<url-pattern>/source/assets/css/aggregate.css</url-pattern>
so the request will be mapped to the default servlet.
The redirect will be generated (depending on the value of
mapperDirectoryRedirectEnabled) either by the Mapper or the default
servlet. All that affects is when the redirect is generated. The
redirect will be the same in either case.
We need to know:
- The httpd proxy configuration
- the context path (assumed to be "/lundase" )
- the full URL path (you can skip the protocol, host and port) of the
request that triggers the problem
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org