You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by rupali singh <ru...@gmail.com> on 2022/03/19 06:03:56 UTC

Fwd: tomcat 9.50 - rewrite rule question

Hi Team,

We are using tomcat 9.54 version.
Need help in rewriting rule.

background   : We have an Oracle apex server ( version 21.1)  and tomcat is
installed on the same server. We have F5 url which redirects to apex
installed on tomcat  eg https://xyz.ae/apex/f?p=1001
<https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
redirects internally to tomcat server on port 8080.

we want to redirect  https://xyz.ae/apex/f?p=1001
<https://xyz.com/apex/f?p=1001>   to
 https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's difficult
for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>

i have prepared context.xml and rewrite.config rule but redirection not
working and there is no error in catalina.log

in access log we are getting 404.

i have tried steps mentioned in
https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex

rewrite.config content

RewriteCond %{REQUEST_URI} ^/myapp$
RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]


please advise how to resolve the issue
-- 
Thanks and Regards,
Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 20.03.22 um 20:17 schrieb rupali singh:
> Hi Thomas,
> thanks for the quick reply.
> I have tried below but it's still not working.
>
> RewriteRule ^/apex/f$  /apex/myapp [R,L]
>
> I have placed rewrite.config on below locations and fileis same in both
> locations , after changing rewrite.config i'm restarting tomcat as well.
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> and
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/apex/WEB-INF/rewrite.config

Have you added the RewriteValve to your context.xml? And if so, are you 
sure, that it is the one, that tomcat uses?

Where did you place context.xml and have you checked 
Catalina/localhost/apex.xml has not been copied earlier?

Felix

>
>
> i'm new to apache tomcat and now aware of how to achieve below.
>
>
> Another option would be to use the source code of tomcat and set a
> breakpoint within the filter class
> (just with a little dummy app deployed).
>
> On Sun, 20 Mar 2022 at 22:46, Thomas Hoffmann (Speed4Trade GmbH)
> <Th...@speed4trade.com.invalid>  wrote:
>
>> Hello,
>>
>> url rewrite doesn't match against url parameters as far as I know.
>> RewriteRule ^/apex/f$  /apex/myapp [R,L]
>>
>> Just a guess, maybe you can  give it a try.
>>
>> Another option would be to use the source code of tomcat and set a
>> breakpoint within the filter class
>> (just with a little dummy app deployed).
>>
>> Greetings, Thomas
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: rupali singh<ru...@gmail.com>
>>> Gesendet: Sonntag, 20. März 2022 19:23
>>> An: Tomcat Users List<us...@tomcat.apache.org>
>>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>>
>>> Hi,
>>>
>>> i have referred Around here:
>>> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>>> but still can't figure out how to write rules for my requirements..
>>> can you please help
>>>
>>> On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
>>> <Th...@speed4trade.com.invalid>  wrote:
>>>
>>>> Hallo,
>>>>
>>>> just scroll down the documentation.
>>>> Around here:
>>>> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>>>> If something is not clear there, just drop a line
>>>>
>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: rupali singh<ru...@gmail.com>
>>>>> Gesendet: Samstag, 19. März 2022 18:28
>>>>> An: Tomcat Users List<us...@tomcat.apache.org>
>>>>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks a lot for your quick response.then what options we have in
>>>>> tomcat apache for rewrite rules.
>>>>>
>>>>> Apologies im new to apache tomcat.
>>>>>
>>>>>
>>>>> On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
>>>>> <te...@tmbsw.com>
>>>>> wrote:
>>>>>
>>>>>> On 3/19/2022 1:03 AM, rupali singh wrote:
>>>>>>> Hi Team,
>>>>>>>
>>>>>>> We are using tomcat 9.54 version.
>>>>>>> Need help in rewriting rule.
>>>>>>>
>>>>>>> background   : We have an Oracle apex server ( version 21.1)  and
>>>> tomcat
>>>>>> is
>>>>>>> installed on the same server. We have F5 url which redirects to
>>>>>>> apex installed on tomcat  eghttps://xyz.ae/apex/f?p=1001
>>>>>>> <https://xyz.com/apex/f?p=1001>    so xyz.ae is published on our
>> F5
>>>>> which
>>>>>>> redirects internally to tomcat server on port 8080.
>>>>>>>
>>>>>>> we want to redirecthttps://xyz.ae/apex/f?p=1001
>>>>>>> <https://xyz.com/apex/f?p=1001>    to
>>>>>>>    https://xyz.ae/apex/myapp  <https://xyz.com/aorx/myapp>    as
>> it's
>>>>>> difficult
>>>>>>> for business users to remember f?p=1001
>>>>>>> <https://xyz.com/apex/f?p=1001>
>>>>>>>
>>>>>>> i have prepared context.xml and rewrite.config rule but
>>>>>>> redirection not working and there is no error in catalina.log
>>>>>>>
>>>>>>> in access log we are getting 404.
>>>>>>>
>>>>>>> i have tried steps mentioned in
>>>>>>>
>>>>>> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
>>>>>> -
>>>>> ord
>>>>>> s-and-oracle-apex
>>>>>>> rewrite.config content
>>>>>>>
>>>>>>> RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
>>>>>>> https://xyz.ae/apex/myapp  [R,L]
>>>>>>>
>>>>>>>
>>>>>>> please advise how to resolve the issue
>>>>>> Those look like Apache HTTPD rewrite rules. How are they supported
>>>>>> in Apache Tomcat?
>>>>>>
>>>>>> -Terence Bandoian
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------
>>>>>> --- To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail:users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>
>>> --
>>> Thanks and Regards,
>>> Rupali
>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi,

Yes im restarting the tomcat after changing the rewrite. Config file.


i have increased log level to FINE


*cat /opt/tomcat/apache-tomcat-9.0.54/instance/conf/logging.properties |
grep FINE*
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
java.util.logging.ConsoleHandler.level = FINE
*org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE*
#org.apache.catalina.util.LifecycleBase.level = FINE
#org.apache.jasper.compiler.TldLocationsCache.level = FINE
#org.apache.coyote.http2.level = FINE
#org.apache.tomcat.websocket.level = FINE


in which log file it will write detailed errors/issues/ trace details

i have checked below files but cant see anything related to rewrite rules.
its all normal logs only

catalina.out
catalina.2022-03-20.log
localhost_access_log.2022-03-20.txt


 cat localhost_access_log.2022-03-20.txt | grep myapp
x.x.x.x - - [20/Mar/2022:20:08:47 +0000] "GET /apex/myapp HTTP/1.1" 404
16681





On Mon, Mar 21, 2022, 1:25 AM Thomas Hoffmann (Speed4Trade GmbH)
<Th...@speed4trade.com.invalid> wrote:

> Hello,
>
> the location under /WEB-INF/ is the correct one.
> Did you restart tomcat afterwards? The config is loaded during startup.
>
> Maybe you can activate logging via logging.properties
>
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE
>
> Should spit out plenty of information in one of the logfiles.
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: rupali singh <ru...@gmail.com>
> > Gesendet: Sonntag, 20. März 2022 20:17
> > An: Tomcat Users List <us...@tomcat.apache.org>
> > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> >
> > Hi Thomas,
> > thanks for the quick reply.
> > I have tried below but it's still not working.
> >
> > RewriteRule ^/apex/f$  /apex/myapp [R,L]
> >
> > I have placed rewrite.config on below locations and fileis same in both
> > locations , after changing rewrite.config i'm restarting tomcat as well.
> > /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-
> > INF/rewrite.config
> > and
> > /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/apex/WEB-
> > INF/rewrite.config
> >
> >
> > i'm new to apache tomcat and now aware of how to achieve below.
> >
> >
> > Another option would be to use the source code of tomcat and set a
> > breakpoint within the filter class (just with a little dummy app
> deployed).
> >
> > On Sun, 20 Mar 2022 at 22:46, Thomas Hoffmann (Speed4Trade GmbH)
> > <Th...@speed4trade.com.invalid> wrote:
> >
> > > Hello,
> > >
> > > url rewrite doesn't match against url parameters as far as I know.
> > > RewriteRule ^/apex/f$  /apex/myapp [R,L]
> > >
> > > Just a guess, maybe you can  give it a try.
> > >
> > > Another option would be to use the source code of tomcat and set a
> > > breakpoint within the filter class (just with a little dummy app
> > > deployed).
> > >
> > > Greetings, Thomas
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: rupali singh <ru...@gmail.com>
> > > > Gesendet: Sonntag, 20. März 2022 19:23
> > > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > > >
> > > > Hi,
> > > >
> > > > i have referred Around here:
> > > > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > > > but still can't figure out how to write rules for my requirements..
> > > > can you please help
> > > >
> > > > On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
> > > > <Th...@speed4trade.com.invalid> wrote:
> > > >
> > > > > Hallo,
> > > > >
> > > > > just scroll down the documentation.
> > > > > Around here:
> > > > > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > > > > If something is not clear there, just drop a line
> > > > >
> > > > >
> > > > > > -----Ursprüngliche Nachricht-----
> > > > > > Von: rupali singh <ru...@gmail.com>
> > > > > > Gesendet: Samstag, 19. März 2022 18:28
> > > > > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > > > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Thanks a lot for your quick response.then what options we have
> > > > > > in tomcat apache for rewrite rules.
> > > > > >
> > > > > > Apologies im new to apache tomcat.
> > > > > >
> > > > > >
> > > > > > On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
> > > > > > <te...@tmbsw.com>
> > > > > > wrote:
> > > > > >
> > > > > > > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > > > > > > Hi Team,
> > > > > > > >
> > > > > > > > We are using tomcat 9.54 version.
> > > > > > > > Need help in rewriting rule.
> > > > > > > >
> > > > > > > > background   : We have an Oracle apex server ( version
> 21.1)  and
> > > > > tomcat
> > > > > > > is
> > > > > > > > installed on the same server. We have F5 url which redirects
> > > > > > > > to apex installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > > > > > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on
> our
> > > F5
> > > > > > which
> > > > > > > > redirects internally to tomcat server on port 8080.
> > > > > > > >
> > > > > > > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > > > > > > <https://xyz.com/apex/f?p=1001>   to
> > > > > > > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>
>  as
> > > it's
> > > > > > > difficult
> > > > > > > > for business users to remember f?p=1001
> > > > > > > > <https://xyz.com/apex/f?p=1001>
> > > > > > > >
> > > > > > > > i have prepared context.xml and rewrite.config rule but
> > > > > > > > redirection not working and there is no error in
> > > > > > > > catalina.log
> > > > > > > >
> > > > > > > > in access log we are getting 404.
> > > > > > > >
> > > > > > > > i have tried steps mentioned in
> > > > > > > >
> > > > > > > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-
> > > > > > > with
> > > > > > > -
> > > > > > ord
> > > > > > > s-and-oracle-apex
> > > > > > > >
> > > > > > > > rewrite.config content
> > > > > > > >
> > > > > > > > RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
> > > > > > > > https://xyz.ae/apex/myapp [R,L]
> > > > > > > >
> > > > > > > >
> > > > > > > > please advise how to resolve the issue
> > > > > > >
> > > > > > > Those look like Apache HTTPD rewrite rules. How are they
> > > > > > > supported in Apache Tomcat?
> > > > > > >
> > > > > > > -Terence Bandoian
> > > > > > >
> > > > > > >
> > > > > > > --------------------------------------------------------------
> > > > > > > ----
> > > > > > > --- To unsubscribe, e-mail:
> > > > > > > users-unsubscribe@tomcat.apache.org
> > > > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > > > >
> > > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Thanks and Regards,
> > > > Rupali
> > >
> >
> >
> > --
> > Thanks and Regards,
> > Rupali
>

AW: Fwd: tomcat 9.50 - rewrite rule question

Posted by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID>.
Hello,

the location under /WEB-INF/ is the correct one.
Did you restart tomcat afterwards? The config is loaded during startup.

Maybe you can activate logging via logging.properties

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = FINE

Should spit out plenty of information in one of the logfiles.


> -----Ursprüngliche Nachricht-----
> Von: rupali singh <ru...@gmail.com>
> Gesendet: Sonntag, 20. März 2022 20:17
> An: Tomcat Users List <us...@tomcat.apache.org>
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> 
> Hi Thomas,
> thanks for the quick reply.
> I have tried below but it's still not working.
> 
> RewriteRule ^/apex/f$  /apex/myapp [R,L]
> 
> I have placed rewrite.config on below locations and fileis same in both
> locations , after changing rewrite.config i'm restarting tomcat as well.
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-
> INF/rewrite.config
> and
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/apex/WEB-
> INF/rewrite.config
> 
> 
> i'm new to apache tomcat and now aware of how to achieve below.
> 
> 
> Another option would be to use the source code of tomcat and set a
> breakpoint within the filter class (just with a little dummy app deployed).
> 
> On Sun, 20 Mar 2022 at 22:46, Thomas Hoffmann (Speed4Trade GmbH)
> <Th...@speed4trade.com.invalid> wrote:
> 
> > Hello,
> >
> > url rewrite doesn't match against url parameters as far as I know.
> > RewriteRule ^/apex/f$  /apex/myapp [R,L]
> >
> > Just a guess, maybe you can  give it a try.
> >
> > Another option would be to use the source code of tomcat and set a
> > breakpoint within the filter class (just with a little dummy app
> > deployed).
> >
> > Greetings, Thomas
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: rupali singh <ru...@gmail.com>
> > > Gesendet: Sonntag, 20. März 2022 19:23
> > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > >
> > > Hi,
> > >
> > > i have referred Around here:
> > > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > > but still can't figure out how to write rules for my requirements..
> > > can you please help
> > >
> > > On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
> > > <Th...@speed4trade.com.invalid> wrote:
> > >
> > > > Hallo,
> > > >
> > > > just scroll down the documentation.
> > > > Around here:
> > > > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > > > If something is not clear there, just drop a line
> > > >
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: rupali singh <ru...@gmail.com>
> > > > > Gesendet: Samstag, 19. März 2022 18:28
> > > > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > > > >
> > > > > Hi,
> > > > >
> > > > > Thanks a lot for your quick response.then what options we have
> > > > > in tomcat apache for rewrite rules.
> > > > >
> > > > > Apologies im new to apache tomcat.
> > > > >
> > > > >
> > > > > On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
> > > > > <te...@tmbsw.com>
> > > > > wrote:
> > > > >
> > > > > > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > > > > > Hi Team,
> > > > > > >
> > > > > > > We are using tomcat 9.54 version.
> > > > > > > Need help in rewriting rule.
> > > > > > >
> > > > > > > background   : We have an Oracle apex server ( version 21.1)  and
> > > > tomcat
> > > > > > is
> > > > > > > installed on the same server. We have F5 url which redirects
> > > > > > > to apex installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > > > > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our
> > F5
> > > > > which
> > > > > > > redirects internally to tomcat server on port 8080.
> > > > > > >
> > > > > > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > > > > > <https://xyz.com/apex/f?p=1001>   to
> > > > > > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as
> > it's
> > > > > > difficult
> > > > > > > for business users to remember f?p=1001
> > > > > > > <https://xyz.com/apex/f?p=1001>
> > > > > > >
> > > > > > > i have prepared context.xml and rewrite.config rule but
> > > > > > > redirection not working and there is no error in
> > > > > > > catalina.log
> > > > > > >
> > > > > > > in access log we are getting 404.
> > > > > > >
> > > > > > > i have tried steps mentioned in
> > > > > > >
> > > > > > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-
> > > > > > with
> > > > > > -
> > > > > ord
> > > > > > s-and-oracle-apex
> > > > > > >
> > > > > > > rewrite.config content
> > > > > > >
> > > > > > > RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
> > > > > > > https://xyz.ae/apex/myapp [R,L]
> > > > > > >
> > > > > > >
> > > > > > > please advise how to resolve the issue
> > > > > >
> > > > > > Those look like Apache HTTPD rewrite rules. How are they
> > > > > > supported in Apache Tomcat?
> > > > > >
> > > > > > -Terence Bandoian
> > > > > >
> > > > > >
> > > > > > --------------------------------------------------------------
> > > > > > ----
> > > > > > --- To unsubscribe, e-mail:
> > > > > > users-unsubscribe@tomcat.apache.org
> > > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > > >
> > > > > >
> > > >
> > >
> > >
> > > --
> > > Thanks and Regards,
> > > Rupali
> >
> 
> 
> --
> Thanks and Regards,
> Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi Thomas,
thanks for the quick reply.
I have tried below but it's still not working.

RewriteRule ^/apex/f$  /apex/myapp [R,L]

I have placed rewrite.config on below locations and fileis same in both
locations , after changing rewrite.config i'm restarting tomcat as well.
/opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
and
/opt/tomcat/apache-tomcat-9.0.54/instance/webapps/apex/WEB-INF/rewrite.config


i'm new to apache tomcat and now aware of how to achieve below.


Another option would be to use the source code of tomcat and set a
breakpoint within the filter class
(just with a little dummy app deployed).

On Sun, 20 Mar 2022 at 22:46, Thomas Hoffmann (Speed4Trade GmbH)
<Th...@speed4trade.com.invalid> wrote:

> Hello,
>
> url rewrite doesn't match against url parameters as far as I know.
> RewriteRule ^/apex/f$  /apex/myapp [R,L]
>
> Just a guess, maybe you can  give it a try.
>
> Another option would be to use the source code of tomcat and set a
> breakpoint within the filter class
> (just with a little dummy app deployed).
>
> Greetings, Thomas
>
> > -----Ursprüngliche Nachricht-----
> > Von: rupali singh <ru...@gmail.com>
> > Gesendet: Sonntag, 20. März 2022 19:23
> > An: Tomcat Users List <us...@tomcat.apache.org>
> > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> >
> > Hi,
> >
> > i have referred Around here:
> > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > but still can't figure out how to write rules for my requirements..
> > can you please help
> >
> > On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
> > <Th...@speed4trade.com.invalid> wrote:
> >
> > > Hallo,
> > >
> > > just scroll down the documentation.
> > > Around here:
> > > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > > If something is not clear there, just drop a line
> > >
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: rupali singh <ru...@gmail.com>
> > > > Gesendet: Samstag, 19. März 2022 18:28
> > > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > > >
> > > > Hi,
> > > >
> > > > Thanks a lot for your quick response.then what options we have in
> > > > tomcat apache for rewrite rules.
> > > >
> > > > Apologies im new to apache tomcat.
> > > >
> > > >
> > > > On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
> > > > <te...@tmbsw.com>
> > > > wrote:
> > > >
> > > > > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > > > > Hi Team,
> > > > > >
> > > > > > We are using tomcat 9.54 version.
> > > > > > Need help in rewriting rule.
> > > > > >
> > > > > > background   : We have an Oracle apex server ( version 21.1)  and
> > > tomcat
> > > > > is
> > > > > > installed on the same server. We have F5 url which redirects to
> > > > > > apex installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > > > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our
> F5
> > > > which
> > > > > > redirects internally to tomcat server on port 8080.
> > > > > >
> > > > > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > > > > <https://xyz.com/apex/f?p=1001>   to
> > > > > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as
> it's
> > > > > difficult
> > > > > > for business users to remember f?p=1001
> > > > > > <https://xyz.com/apex/f?p=1001>
> > > > > >
> > > > > > i have prepared context.xml and rewrite.config rule but
> > > > > > redirection not working and there is no error in catalina.log
> > > > > >
> > > > > > in access log we are getting 404.
> > > > > >
> > > > > > i have tried steps mentioned in
> > > > > >
> > > > > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
> > > > > -
> > > > ord
> > > > > s-and-oracle-apex
> > > > > >
> > > > > > rewrite.config content
> > > > > >
> > > > > > RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
> > > > > > https://xyz.ae/apex/myapp [R,L]
> > > > > >
> > > > > >
> > > > > > please advise how to resolve the issue
> > > > >
> > > > > Those look like Apache HTTPD rewrite rules. How are they supported
> > > > > in Apache Tomcat?
> > > > >
> > > > > -Terence Bandoian
> > > > >
> > > > >
> > > > > ------------------------------------------------------------------
> > > > > --- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > > >
> > > > >
> > >
> >
> >
> > --
> > Thanks and Regards,
> > Rupali
>


-- 
Thanks and Regards,
Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Rupali,

On 3/25/22 11:28, rupali singh wrote:
> hi chris,
> 
> Apologies for typo mistakes.
> 
> business user are using url :   https://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>   to login into apex application and login
> is working fine.
> 
> xyz.ae is published in our F5 which is pointing to tomcat server on port
> 8080  hence im not worried about xyz.ae
> 
> for making is simple for user we want to rename f?p=1001
> <https://xyz.com/apex/f?p=1001>   to myapp
> so business user will use https://xyz.ae/apex/myapp
> <https://xyz.com/aorx/myapp>
> 
> So our requirement is  :   in url we want to replace f?p=1001
> <https://xyz.com/apex/f?p=1001> to myapp
> 
> 
> tried below but not working
> 
> RewriteCond %{QUERY_STRING} p=1001
> RewriteRule ^/f$ /apex/myapp

It looks like you are doing this backward: your rewrite rule will take a 
URL coming from a user (at the time they request it!) which looks like this:

https://xyz.ae/apex/f?p=1001

and re-write the URL to:

/apex/myapp

You want to do the opposite: the user supplies the URL /apex/myapp and 
you internally convert it to /apex/f?p=1001

Right?

You want users to use the "friendly" URLs, not the internal system.

> rewrite.config location :
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config

This is the major problem: you have put your rewrite rules into the ROOT 
web application (context path=/), but your request is being sent to the 
web application deployed into the /apex context path.

You need to:

1. Move your file to .../instance/webapps/apex/WEB-INF/rewrite.config
2. Remove the "/apex" from the beginning of all your URLs in rewrite.config

> curl output:
> curl -D- 'localhost:8080/apex/f?p=10001'
> HTTP/1.1 302
> X-Content-Type-Options: nosniff
> X-Xss-Protection: 1; mode=block
> Referrer-Policy: strict-origin-when-cross-origin
> Location: https://localhost/apex/workspace/r/abcrelease10001123100/home
> Transfer-Encoding: chunked
> Date: Fri, 25 Mar 2022 15:18:16 GMT

Hmmmmm. So you really *do* want to re-write non-friendly URLs into 
friendly ones. I'm very confused.

So you are expecting a 302 response from Tomcat but pointing to 
/apex/myapp ?

What component of your system is returning the 302 above?

-chris

> On Fri, 25 Mar 2022 at 16:52, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
>> Rupali,
>>
>> This has gone around in circles for a while with no progress. Can you
>> please:
>>
>> 1. Show examples of what you would like. Specific examples, like:
>>
>> "I expect that when requesting http://xyz.ae/apex/?f=1001" I get a 302
>> redirect to http://xyz.ae/apex/myapp"
>>
>> That's what you are asking for, but I suspect that what you really want
>> is the reverse: users who request /myapp actually get "?f=1001".
>>
>> This is further complicated by the fact that all your URLs show as
>> ayx.ae in text, but then have <xyz.com> added to the end for some
>> reason. Which is it?
>>
>> Do you want an HTTP redirect? If so, what kind? Or do you want your
>> server to proxy from one URL to the other, so the client doesn't know
>> it's happening?
>>
>> 2. Which component should be responsible for all of this? You have
>> several networking components to choose from:
>>
>> a. F5 load balancer
>> b. Oracle Apex
>> c. Apache Tomcat
>>
>> Why have you decided to re-write your application's URLs at the Tomcat
>> level and not somewhere further up the chain?
>>
>> 3. Show exactly what you currently have in your rewrite config file, and
>> exactly where that rewrite configuration file is on the disk.
>>
>> Going back to your original post, lots of things are confusing:
>>
>> i. The URLs are inconsistent (.ae va .com, apex vs aorx)
>>
>> ii. You appear to be asking to redirect from non-friendly URLs to
>> friendly URLs which doesn't make any sense. Perhaps this is a
>> terminology issue. You want clients to use the friendly URLs
>> (/apex/myapp) and then get what they would have received had they called
>> /f?p=1001 right?
>>
>> iii. You are redirecting /myapp to /myapp in your example, which
>> accomplishes nothing. You also have the same rule twice.
>>
>> This should be as simple as:
>>
>> RewriteRule "^/f?p=1001" "/myapp"
>>
>> ... but it's not, because RewriteRule only looks at the path and not the
>> query string, so you need a separate condition. I'll repeat what Felix
>> (almost) posted a few days ago, which should be correct:
>>
>> RewriteCond %{QUERY_STRING} p=1001
>> RewriteRule ^/f$ /apex/myapp
>>
>> I don't think you even want the [R] flag because if you do that, the
>> client will see the URL change to the unfriendly URL, and the point is
>> to hide that from them, right?
>>
>> The last thing to do is to make sure the file is *in the right place*.
>> No amount of configuration in C:\Windows\rewrite.config is going to have
>> any effect unless you have a very strange configuration.
>>
>> -chris
>>
>> On 3/24/22 14:23, rupali singh wrote:
>>> hi,
>>>
>>> yes context name is apex.
>>>
>>>    https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001>   to
>>> https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>
>>>
>>> we dont want to change xyz.ae that will name remain as it is , we want
>> to
>>> change f?p=1001 <https://xyz.com/apex/f?p=1001> to myapp
>>>
>>>
>>>
>>> On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
>>> felix.schumacher@internetallee.de> wrote:
>>>
>>>>
>>>>
>>>> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
>>>> rupali.r.singh@gmail.com>:
>>>>> Hi Chris,
>>>>>
>>>>> I already tried with fully qualified name but its not working
>>>>
>>>> Can you be more specific, what you tried?
>>>>
>>>> Is Chris right and your context name is apex?
>>>>
>>>> Felix
>>>>>
>>>>> On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
>>>>> chris@christopherschultz.net> wrote:
>>>>>
>>>>>> All,
>>>>>>
>>>>>> On 3/21/22 10:19, Felix Schumacher wrote:
>>>>>>>
>>>>>>> Am 21.03.22 um 06:39 schrieb rupali singh:
>>>>>>>> Hi Felix,
>>>>>>>>
>>>>>>>> location of context.xml file is
>>>>>>>>
>>>>>>>>     cat context.xml| grep RewriteValve
>>>>>>>>        <Valve
>>>> className="org.apache.catalina.valves.rewrite.RewriteValve"
>>>>>> />
>>>>>>>>     pwd
>>>>>>>> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
>>>>>>> That context.xml is thought to be a default template for all
>> installed
>>>>>>> webapps. It will work, but remember, that every installed webapp will
>>>>>>> get its own copy of a rewrite valve.
>>>>>>
>>>>>> +1
>>>>>>
>>>>>> This is probably the problem.
>>>>>>
>>>>>>>> more
>>>>>>>>
>>>>>>
>>>>
>> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>>>>>>>> RewriteCond %{QUERY_STRING} p=10001
>>>>>>>> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>>>>>>
>>>>>>
>>>>>> I think you want:
>>>>>>
>>>>>> RewriteCond %{QUERY_STRING} p=10001
>>>>>> RewriteRule ^/f$ /myapp [R,L]
>>>>>>
>>>>>> The prefix /apex is already a part of the context-path and should be
>>>>>> removed from the URL patterns being matched. If you want to redirect
>> to
>>>>>> another web application, you need a fully-qualified redirect like
>> this:
>>>>>>
>>>>>> RewriteCond %{QUERY_STRING} p=10001
>>>>>> RewriteRule ^/f$ https://www.google.com/ [R,L]
>>>>>>
>>>>>> -chris
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
hi chris,

Apologies for typo mistakes.

business user are using url :   https://xyz.ae/apex/f?p=1001
<https://xyz.com/apex/f?p=1001>   to login into apex application and login
is working fine.

xyz.ae is published in our F5 which is pointing to tomcat server on port
8080  hence im not worried about xyz.ae

for making is simple for user we want to rename f?p=1001
<https://xyz.com/apex/f?p=1001>   to myapp
so business user will use https://xyz.ae/apex/myapp
<https://xyz.com/aorx/myapp>

So our requirement is  :   in url we want to replace f?p=1001
<https://xyz.com/apex/f?p=1001> to myapp


tried below but not working

RewriteCond %{QUERY_STRING} p=1001
RewriteRule ^/f$ /apex/myapp

rewrite.config location :
/opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config


Thanks Peter for suggestion but configure friendly URLs is not our
requirement.


We have achieved  our requirement  where apex is deployed on oracle
weblogic with Oracle HTTP server.
Now same want to achieve with apex-tomcat


curl output:
curl -D- 'localhost:8080/apex/f?p=10001'
HTTP/1.1 302
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block
Referrer-Policy: strict-origin-when-cross-origin
Location: https://localhost/apex/workspace/r/abcrelease10001123100/home
Transfer-Encoding: chunked
Date: Fri, 25 Mar 2022 15:18:16 GMT

On Fri, 25 Mar 2022 at 16:52, Christopher Schultz <
chris@christopherschultz.net> wrote:

> Rupali,
>
> This has gone around in circles for a while with no progress. Can you
> please:
>
> 1. Show examples of what you would like. Specific examples, like:
>
> "I expect that when requesting http://xyz.ae/apex/?f=1001" I get a 302
> redirect to http://xyz.ae/apex/myapp"
>
> That's what you are asking for, but I suspect that what you really want
> is the reverse: users who request /myapp actually get "?f=1001".
>
> This is further complicated by the fact that all your URLs show as
> ayx.ae in text, but then have <xyz.com> added to the end for some
> reason. Which is it?
>
> Do you want an HTTP redirect? If so, what kind? Or do you want your
> server to proxy from one URL to the other, so the client doesn't know
> it's happening?
>
> 2. Which component should be responsible for all of this? You have
> several networking components to choose from:
>
> a. F5 load balancer
> b. Oracle Apex
> c. Apache Tomcat
>
> Why have you decided to re-write your application's URLs at the Tomcat
> level and not somewhere further up the chain?
>
> 3. Show exactly what you currently have in your rewrite config file, and
> exactly where that rewrite configuration file is on the disk.
>
> Going back to your original post, lots of things are confusing:
>
> i. The URLs are inconsistent (.ae va .com, apex vs aorx)
>
> ii. You appear to be asking to redirect from non-friendly URLs to
> friendly URLs which doesn't make any sense. Perhaps this is a
> terminology issue. You want clients to use the friendly URLs
> (/apex/myapp) and then get what they would have received had they called
> /f?p=1001 right?
>
> iii. You are redirecting /myapp to /myapp in your example, which
> accomplishes nothing. You also have the same rule twice.
>
> This should be as simple as:
>
> RewriteRule "^/f?p=1001" "/myapp"
>
> ... but it's not, because RewriteRule only looks at the path and not the
> query string, so you need a separate condition. I'll repeat what Felix
> (almost) posted a few days ago, which should be correct:
>
> RewriteCond %{QUERY_STRING} p=1001
> RewriteRule ^/f$ /apex/myapp
>
> I don't think you even want the [R] flag because if you do that, the
> client will see the URL change to the unfriendly URL, and the point is
> to hide that from them, right?
>
> The last thing to do is to make sure the file is *in the right place*.
> No amount of configuration in C:\Windows\rewrite.config is going to have
> any effect unless you have a very strange configuration.
>
> -chris
>
> On 3/24/22 14:23, rupali singh wrote:
> > hi,
> >
> > yes context name is apex.
> >
> >   https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001>   to
> > https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>
> >
> > we dont want to change xyz.ae that will name remain as it is , we want
> to
> > change f?p=1001 <https://xyz.com/apex/f?p=1001> to myapp
> >
> >
> >
> > On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
> > felix.schumacher@internetallee.de> wrote:
> >
> >>
> >>
> >> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
> >> rupali.r.singh@gmail.com>:
> >>> Hi Chris,
> >>>
> >>> I already tried with fully qualified name but its not working
> >>
> >> Can you be more specific, what you tried?
> >>
> >> Is Chris right and your context name is apex?
> >>
> >> Felix
> >>>
> >>> On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
> >>> chris@christopherschultz.net> wrote:
> >>>
> >>>> All,
> >>>>
> >>>> On 3/21/22 10:19, Felix Schumacher wrote:
> >>>>>
> >>>>> Am 21.03.22 um 06:39 schrieb rupali singh:
> >>>>>> Hi Felix,
> >>>>>>
> >>>>>> location of context.xml file is
> >>>>>>
> >>>>>>    cat context.xml| grep RewriteValve
> >>>>>>       <Valve
> >> className="org.apache.catalina.valves.rewrite.RewriteValve"
> >>>> />
> >>>>>>    pwd
> >>>>>> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> >>>>> That context.xml is thought to be a default template for all
> installed
> >>>>> webapps. It will work, but remember, that every installed webapp will
> >>>>> get its own copy of a rewrite valve.
> >>>>
> >>>> +1
> >>>>
> >>>> This is probably the problem.
> >>>>
> >>>>>> more
> >>>>>>
> >>>>
> >>
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> >>>>>> RewriteCond %{QUERY_STRING} p=10001
> >>>>>> RewriteRule ^/apex/f$ /apex/myapp [R,L]
> >>>>
> >>>>
> >>>> I think you want:
> >>>>
> >>>> RewriteCond %{QUERY_STRING} p=10001
> >>>> RewriteRule ^/f$ /myapp [R,L]
> >>>>
> >>>> The prefix /apex is already a part of the context-path and should be
> >>>> removed from the URL patterns being matched. If you want to redirect
> to
> >>>> another web application, you need a fully-qualified redirect like
> this:
> >>>>
> >>>> RewriteCond %{QUERY_STRING} p=10001
> >>>> RewriteRule ^/f$ https://www.google.com/ [R,L]
> >>>>
> >>>> -chris
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Thanks and Regards,
Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Rupali,

This has gone around in circles for a while with no progress. Can you 
please:

1. Show examples of what you would like. Specific examples, like:

"I expect that when requesting http://xyz.ae/apex/?f=1001" I get a 302 
redirect to http://xyz.ae/apex/myapp"

That's what you are asking for, but I suspect that what you really want 
is the reverse: users who request /myapp actually get "?f=1001".

This is further complicated by the fact that all your URLs show as 
ayx.ae in text, but then have <xyz.com> added to the end for some 
reason. Which is it?

Do you want an HTTP redirect? If so, what kind? Or do you want your 
server to proxy from one URL to the other, so the client doesn't know 
it's happening?

2. Which component should be responsible for all of this? You have 
several networking components to choose from:

a. F5 load balancer
b. Oracle Apex
c. Apache Tomcat

Why have you decided to re-write your application's URLs at the Tomcat 
level and not somewhere further up the chain?

3. Show exactly what you currently have in your rewrite config file, and 
exactly where that rewrite configuration file is on the disk.

Going back to your original post, lots of things are confusing:

i. The URLs are inconsistent (.ae va .com, apex vs aorx)

ii. You appear to be asking to redirect from non-friendly URLs to 
friendly URLs which doesn't make any sense. Perhaps this is a 
terminology issue. You want clients to use the friendly URLs 
(/apex/myapp) and then get what they would have received had they called 
/f?p=1001 right?

iii. You are redirecting /myapp to /myapp in your example, which 
accomplishes nothing. You also have the same rule twice.

This should be as simple as:

RewriteRule "^/f?p=1001" "/myapp"

... but it's not, because RewriteRule only looks at the path and not the 
query string, so you need a separate condition. I'll repeat what Felix 
(almost) posted a few days ago, which should be correct:

RewriteCond %{QUERY_STRING} p=1001
RewriteRule ^/f$ /apex/myapp

I don't think you even want the [R] flag because if you do that, the 
client will see the URL change to the unfriendly URL, and the point is 
to hide that from them, right?

The last thing to do is to make sure the file is *in the right place*. 
No amount of configuration in C:\Windows\rewrite.config is going to have 
any effect unless you have a very strange configuration.

-chris

On 3/24/22 14:23, rupali singh wrote:
> hi,
> 
> yes context name is apex.
> 
>   https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001>   to
> https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>
> 
> we dont want to change xyz.ae that will name remain as it is , we want to
> change f?p=1001 <https://xyz.com/apex/f?p=1001> to myapp
> 
> 
> 
> On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
> 
>>
>>
>> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
>> rupali.r.singh@gmail.com>:
>>> Hi Chris,
>>>
>>> I already tried with fully qualified name but its not working
>>
>> Can you be more specific, what you tried?
>>
>> Is Chris right and your context name is apex?
>>
>> Felix
>>>
>>> On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> All,
>>>>
>>>> On 3/21/22 10:19, Felix Schumacher wrote:
>>>>>
>>>>> Am 21.03.22 um 06:39 schrieb rupali singh:
>>>>>> Hi Felix,
>>>>>>
>>>>>> location of context.xml file is
>>>>>>
>>>>>>    cat context.xml| grep RewriteValve
>>>>>>       <Valve
>> className="org.apache.catalina.valves.rewrite.RewriteValve"
>>>> />
>>>>>>    pwd
>>>>>> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
>>>>> That context.xml is thought to be a default template for all installed
>>>>> webapps. It will work, but remember, that every installed webapp will
>>>>> get its own copy of a rewrite valve.
>>>>
>>>> +1
>>>>
>>>> This is probably the problem.
>>>>
>>>>>> more
>>>>>>
>>>>
>> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>>>>>> RewriteCond %{QUERY_STRING} p=10001
>>>>>> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>>>>
>>>>
>>>> I think you want:
>>>>
>>>> RewriteCond %{QUERY_STRING} p=10001
>>>> RewriteRule ^/f$ /myapp [R,L]
>>>>
>>>> The prefix /apex is already a part of the context-path and should be
>>>> removed from the URL patterns being matched. If you want to redirect to
>>>> another web application, you need a fully-qualified redirect like this:
>>>>
>>>> RewriteCond %{QUERY_STRING} p=10001
>>>> RewriteRule ^/f$ https://www.google.com/ [R,L]
>>>>
>>>> -chris
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Rob Sargent <rs...@xmission.com>.

On 3/24/22 13:27, Peter Chiu wrote:
> Application builder->Your application->Shared Components->Application
> Definition Attributes->Properties->Friendly URLs
>
>
And that does what, exactly?


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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Peter Chiu <pc...@gmail.com>.
Application builder->Your application->Shared Components->Application
Definition Attributes->Properties->Friendly URLs

On Thu, Mar 24, 2022 at 3:25 PM rupali singh <ru...@gmail.com>
wrote:

> Hi,
>
> How we can enable friendly url in apex?
>
>
>
> On Fri, Mar 25, 2022, 12:48 AM Peter Chiu <pc...@gmail.com> wrote:
>
> > Have you consider doing the following
> > 1. custom URL/domain, and
> > 2. enable Friendly URLs in APEX
> >
> > On Thu, Mar 24, 2022 at 3:09 PM Felix Schumacher <
> > felix.schumacher@internetallee.de> wrote:
> >
> > >
> > > Am 24.03.22 um 19:23 schrieb rupali singh:
> > >
> > > hi,
> > >
> > > yes context name is apex.
> > >
> > > Good to know.
> > >
> > >  https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001> <
> > https://xyz.com/apex/f?p=1001>   tohttps://xyz.ae/apex/myapp <
> > https://xyz.com/aorx/myapp> <https://xyz.com/aorx/myapp>
> > >
> > > we dont want to change xyz.ae that will name remain as it is , we want
> > to
> > > change f?p=1001 <https://xyz.com/apex/f?p=1001> <
> > https://xyz.com/apex/f?p=1001> to myapp
> > >
> > > Sorry, I don't understand, what you meant by the above.
> > >
> > > I suspect, that you wanted to show, what the user enters into the
> browser
> > > and where the application listens. But it doesn't really makes sense to
> > me.
> > >
> > > Reading your first mail again, I think, that you have a loadbalancer
> that
> > > listens on xyz.ae and that proxies to xyz.com (you mentioned port
> 8080,
> > > which is left out in all your examples). Is that right?
> > >
> > > Apart from that, I wanted to know, what you tried on a technical level.
> > > Have you tried the curl command that I gave as an example?
> > >
> > > Felix
> > >
> > > On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
> > felix.schumacher@internetallee.de> wrote:
> > >
> > >
> > > Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
> > rupali.r.singh@gmail.com>:
> > >
> > > Hi Chris,
> > >
> > > I already tried with fully qualified name but its not working
> > >
> > > Can you be more specific, what you tried?
> > >
> > > Is Chris right and your context name is apex?
> > >
> > > Felix
> > >
> > > On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> > >
> > >
> > > All,
> > >
> > > On 3/21/22 10:19, Felix Schumacher wrote:
> > >
> > > Am 21.03.22 um 06:39 schrieb rupali singh:
> > >
> > > Hi Felix,
> > >
> > > location of context.xml file is
> > >
> > >   cat context.xml| grep RewriteValve
> > >      <Valve
> > >
> > > className="org.apache.catalina.valves.rewrite.RewriteValve"
> > >
> > > />
> > >
> > >   pwd
> > > /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> > >
> > > That context.xml is thought to be a default template for all installed
> > > webapps. It will work, but remember, that every installed webapp will
> > > get its own copy of a rewrite valve.
> > >
> > > +1
> > >
> > > This is probably the problem.
> > >
> > >
> > > more
> > >
> > >
> > >
> >
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> > >
> > > RewriteCond %{QUERY_STRING} p=10001
> > > RewriteRule ^/apex/f$ /apex/myapp [R,L]
> > >
> > > I think you want:
> > >
> > > RewriteCond %{QUERY_STRING} p=10001
> > > RewriteRule ^/f$ /myapp [R,L]
> > >
> > > The prefix /apex is already a part of the context-path and should be
> > > removed from the URL patterns being matched. If you want to redirect to
> > > another web application, you need a fully-qualified redirect like this:
> > >
> > > RewriteCond %{QUERY_STRING} p=10001
> > > RewriteRule ^/f$ https://www.google.com/ [R,L]
> > >
> > > -chris
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >  ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> >
>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi,

How we can enable friendly url in apex?



On Fri, Mar 25, 2022, 12:48 AM Peter Chiu <pc...@gmail.com> wrote:

> Have you consider doing the following
> 1. custom URL/domain, and
> 2. enable Friendly URLs in APEX
>
> On Thu, Mar 24, 2022 at 3:09 PM Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
> >
> > Am 24.03.22 um 19:23 schrieb rupali singh:
> >
> > hi,
> >
> > yes context name is apex.
> >
> > Good to know.
> >
> >  https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001> <
> https://xyz.com/apex/f?p=1001>   tohttps://xyz.ae/apex/myapp <
> https://xyz.com/aorx/myapp> <https://xyz.com/aorx/myapp>
> >
> > we dont want to change xyz.ae that will name remain as it is , we want
> to
> > change f?p=1001 <https://xyz.com/apex/f?p=1001> <
> https://xyz.com/apex/f?p=1001> to myapp
> >
> > Sorry, I don't understand, what you meant by the above.
> >
> > I suspect, that you wanted to show, what the user enters into the browser
> > and where the application listens. But it doesn't really makes sense to
> me.
> >
> > Reading your first mail again, I think, that you have a loadbalancer that
> > listens on xyz.ae and that proxies to xyz.com (you mentioned port 8080,
> > which is left out in all your examples). Is that right?
> >
> > Apart from that, I wanted to know, what you tried on a technical level.
> > Have you tried the curl command that I gave as an example?
> >
> > Felix
> >
> > On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
> >
> >
> > Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
> rupali.r.singh@gmail.com>:
> >
> > Hi Chris,
> >
> > I already tried with fully qualified name but its not working
> >
> > Can you be more specific, what you tried?
> >
> > Is Chris right and your context name is apex?
> >
> > Felix
> >
> > On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
> chris@christopherschultz.net> wrote:
> >
> >
> > All,
> >
> > On 3/21/22 10:19, Felix Schumacher wrote:
> >
> > Am 21.03.22 um 06:39 schrieb rupali singh:
> >
> > Hi Felix,
> >
> > location of context.xml file is
> >
> >   cat context.xml| grep RewriteValve
> >      <Valve
> >
> > className="org.apache.catalina.valves.rewrite.RewriteValve"
> >
> > />
> >
> >   pwd
> > /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> >
> > That context.xml is thought to be a default template for all installed
> > webapps. It will work, but remember, that every installed webapp will
> > get its own copy of a rewrite valve.
> >
> > +1
> >
> > This is probably the problem.
> >
> >
> > more
> >
> >
> >
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> >
> > RewriteCond %{QUERY_STRING} p=10001
> > RewriteRule ^/apex/f$ /apex/myapp [R,L]
> >
> > I think you want:
> >
> > RewriteCond %{QUERY_STRING} p=10001
> > RewriteRule ^/f$ /myapp [R,L]
> >
> > The prefix /apex is already a part of the context-path and should be
> > removed from the URL patterns being matched. If you want to redirect to
> > another web application, you need a fully-qualified redirect like this:
> >
> > RewriteCond %{QUERY_STRING} p=10001
> > RewriteRule ^/f$ https://www.google.com/ [R,L]
> >
> > -chris
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >  ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Peter Chiu <pc...@gmail.com>.
Have you consider doing the following
1. custom URL/domain, and
2. enable Friendly URLs in APEX

On Thu, Mar 24, 2022 at 3:09 PM Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
> Am 24.03.22 um 19:23 schrieb rupali singh:
>
> hi,
>
> yes context name is apex.
>
> Good to know.
>
>  https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001> <https://xyz.com/apex/f?p=1001>   tohttps://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp> <https://xyz.com/aorx/myapp>
>
> we dont want to change xyz.ae that will name remain as it is , we want to
> change f?p=1001 <https://xyz.com/apex/f?p=1001> <https://xyz.com/apex/f?p=1001> to myapp
>
> Sorry, I don't understand, what you meant by the above.
>
> I suspect, that you wanted to show, what the user enters into the browser
> and where the application listens. But it doesn't really makes sense to me.
>
> Reading your first mail again, I think, that you have a loadbalancer that
> listens on xyz.ae and that proxies to xyz.com (you mentioned port 8080,
> which is left out in all your examples). Is that right?
>
> Apart from that, I wanted to know, what you tried on a technical level.
> Have you tried the curl command that I gave as an example?
>
> Felix
>
> On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <fe...@internetallee.de> wrote:
>
>
> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <ru...@gmail.com>:
>
> Hi Chris,
>
> I already tried with fully qualified name but its not working
>
> Can you be more specific, what you tried?
>
> Is Chris right and your context name is apex?
>
> Felix
>
> On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <ch...@christopherschultz.net> wrote:
>
>
> All,
>
> On 3/21/22 10:19, Felix Schumacher wrote:
>
> Am 21.03.22 um 06:39 schrieb rupali singh:
>
> Hi Felix,
>
> location of context.xml file is
>
>   cat context.xml| grep RewriteValve
>      <Valve
>
> className="org.apache.catalina.valves.rewrite.RewriteValve"
>
> />
>
>   pwd
> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
>
> That context.xml is thought to be a default template for all installed
> webapps. It will work, but remember, that every installed webapp will
> get its own copy of a rewrite valve.
>
> +1
>
> This is probably the problem.
>
>
> more
>
>
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>
> I think you want:
>
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/f$ /myapp [R,L]
>
> The prefix /apex is already a part of the context-path and should be
> removed from the URL patterns being matched. If you want to redirect to
> another web application, you need a fully-qualified redirect like this:
>
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/f$ https://www.google.com/ [R,L]
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 24.03.22 um 19:23 schrieb rupali singh:
> hi,
>
> yes context name is apex.
Good to know.
>
>   https://xyz.ae/apex/f?p=1001  <https://xyz.com/apex/f?p=1001>    to
> https://xyz.ae/apex/myapp  <https://xyz.com/aorx/myapp>
>
> we dont want to change xyz.ae that will name remain as it is , we want to
> change f?p=1001<https://xyz.com/apex/f?p=1001>  to myapp

Sorry, I don't understand, what you meant by the above.

I suspect, that you wanted to show, what the user enters into the 
browser and where the application listens. But it doesn't really makes 
sense to me.

Reading your first mail again, I think, that you have a loadbalancer 
that listens on xyz.ae and that proxies to xyz.com (you mentioned port 
8080, which is left out in all your examples). Is that right?

Apart from that, I wanted to know, what you tried on a technical level. 
Have you tried the curl command that I gave as an example?

Felix

>
>
> On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
>>
>> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
>> rupali.r.singh@gmail.com>:
>>> Hi Chris,
>>>
>>> I already tried with fully qualified name but its not working
>> Can you be more specific, what you tried?
>>
>> Is Chris right and your context name is apex?
>>
>> Felix
>>> On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> All,
>>>>
>>>> On 3/21/22 10:19, Felix Schumacher wrote:
>>>>> Am 21.03.22 um 06:39 schrieb rupali singh:
>>>>>> Hi Felix,
>>>>>>
>>>>>> location of context.xml file is
>>>>>>
>>>>>>    cat context.xml| grep RewriteValve
>>>>>>       <Valve
>> className="org.apache.catalina.valves.rewrite.RewriteValve"
>>>> />
>>>>>>    pwd
>>>>>> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
>>>>> That context.xml is thought to be a default template for all installed
>>>>> webapps. It will work, but remember, that every installed webapp will
>>>>> get its own copy of a rewrite valve.
>>>> +1
>>>>
>>>> This is probably the problem.
>>>>
>>>>>> more
>>>>>>
>> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>>>>>> RewriteCond %{QUERY_STRING} p=10001
>>>>>> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>>>>
>>>> I think you want:
>>>>
>>>> RewriteCond %{QUERY_STRING} p=10001
>>>> RewriteRule ^/f$ /myapp [R,L]
>>>>
>>>> The prefix /apex is already a part of the context-path and should be
>>>> removed from the URL patterns being matched. If you want to redirect to
>>>> another web application, you need a fully-qualified redirect like this:
>>>>
>>>> RewriteCond %{QUERY_STRING} p=10001
>>>> RewriteRule ^/f$https://www.google.com/  [R,L]
>>>>
>>>> -chris
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail:users-help@tomcat.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail:users-help@tomcat.apache.org
>>
>>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
hi,

yes context name is apex.

 https://xyz.ae/apex/f?p=1001 <https://xyz.com/apex/f?p=1001>   to
https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>

we dont want to change xyz.ae that will name remain as it is , we want to
change f?p=1001 <https://xyz.com/apex/f?p=1001> to myapp



On Wed, 23 Mar 2022 at 19:23, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
>
> Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <
> rupali.r.singh@gmail.com>:
> >Hi Chris,
> >
> >I already tried with fully qualified name but its not working
>
> Can you be more specific, what you tried?
>
> Is Chris right and your context name is apex?
>
> Felix
> >
> >On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
> >chris@christopherschultz.net> wrote:
> >
> >> All,
> >>
> >> On 3/21/22 10:19, Felix Schumacher wrote:
> >> >
> >> > Am 21.03.22 um 06:39 schrieb rupali singh:
> >> >> Hi Felix,
> >> >>
> >> >> location of context.xml file is
> >> >>
> >> >>   cat context.xml| grep RewriteValve
> >> >>      <Valve
> className="org.apache.catalina.valves.rewrite.RewriteValve"
> >> />
> >> >>   pwd
> >> >> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> >> > That context.xml is thought to be a default template for all installed
> >> > webapps. It will work, but remember, that every installed webapp will
> >> > get its own copy of a rewrite valve.
> >>
> >> +1
> >>
> >> This is probably the problem.
> >>
> >> >> more
> >> >>
> >>
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> >> >> RewriteCond %{QUERY_STRING} p=10001
> >> >> RewriteRule ^/apex/f$ /apex/myapp [R,L]
> >>
> >>
> >> I think you want:
> >>
> >> RewriteCond %{QUERY_STRING} p=10001
> >> RewriteRule ^/f$ /myapp [R,L]
> >>
> >> The prefix /apex is already a part of the context-path and should be
> >> removed from the URL patterns being matched. If you want to redirect to
> >> another web application, you need a fully-qualified redirect like this:
> >>
> >> RewriteCond %{QUERY_STRING} p=10001
> >> RewriteRule ^/f$ https://www.google.com/ [R,L]
> >>
> >> -chris
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Thanks and Regards,
Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 23. März 2022 12:14:25 MEZ schrieb rupali singh <ru...@gmail.com>:
>Hi Chris,
>
>I already tried with fully qualified name but its not working

Can you be more specific, what you tried?

Is Chris right and your context name is apex? 

Felix
>
>On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
>chris@christopherschultz.net> wrote:
>
>> All,
>>
>> On 3/21/22 10:19, Felix Schumacher wrote:
>> >
>> > Am 21.03.22 um 06:39 schrieb rupali singh:
>> >> Hi Felix,
>> >>
>> >> location of context.xml file is
>> >>
>> >>   cat context.xml| grep RewriteValve
>> >>      <Valve className="org.apache.catalina.valves.rewrite.RewriteValve"
>> />
>> >>   pwd
>> >> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
>> > That context.xml is thought to be a default template for all installed
>> > webapps. It will work, but remember, that every installed webapp will
>> > get its own copy of a rewrite valve.
>>
>> +1
>>
>> This is probably the problem.
>>
>> >> more
>> >>
>> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>> >> RewriteCond %{QUERY_STRING} p=10001
>> >> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>>
>>
>> I think you want:
>>
>> RewriteCond %{QUERY_STRING} p=10001
>> RewriteRule ^/f$ /myapp [R,L]
>>
>> The prefix /apex is already a part of the context-path and should be
>> removed from the URL patterns being matched. If you want to redirect to
>> another web application, you need a fully-qualified redirect like this:
>>
>> RewriteCond %{QUERY_STRING} p=10001
>> RewriteRule ^/f$ https://www.google.com/ [R,L]
>>
>> -chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi Chris,

I already tried with fully qualified name but its not working

On Tue, Mar 22, 2022, 7:15 PM Christopher Schultz <
chris@christopherschultz.net> wrote:

> All,
>
> On 3/21/22 10:19, Felix Schumacher wrote:
> >
> > Am 21.03.22 um 06:39 schrieb rupali singh:
> >> Hi Felix,
> >>
> >> location of context.xml file is
> >>
> >>   cat context.xml| grep RewriteValve
> >>      <Valve className="org.apache.catalina.valves.rewrite.RewriteValve"
> />
> >>   pwd
> >> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> > That context.xml is thought to be a default template for all installed
> > webapps. It will work, but remember, that every installed webapp will
> > get its own copy of a rewrite valve.
>
> +1
>
> This is probably the problem.
>
> >> more
> >>
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> >> RewriteCond %{QUERY_STRING} p=10001
> >> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>
>
> I think you want:
>
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/f$ /myapp [R,L]
>
> The prefix /apex is already a part of the context-path and should be
> removed from the URL patterns being matched. If you want to redirect to
> another web application, you need a fully-qualified redirect like this:
>
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/f$ https://www.google.com/ [R,L]
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Christopher Schultz <ch...@christopherschultz.net>.
All,

On 3/21/22 10:19, Felix Schumacher wrote:
> 
> Am 21.03.22 um 06:39 schrieb rupali singh:
>> Hi Felix,
>>
>> location of context.xml file is
>>
>>   cat context.xml| grep RewriteValve
>>      <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
>>   pwd
>> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
> That context.xml is thought to be a default template for all installed 
> webapps. It will work, but remember, that every installed webapp will 
> get its own copy of a rewrite valve.

+1

This is probably the problem.

>> more
>> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
>> RewriteCond %{QUERY_STRING} p=10001
>> RewriteRule ^/apex/f$ /apex/myapp [R,L]


I think you want:

RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/f$ /myapp [R,L]

The prefix /apex is already a part of the context-path and should be 
removed from the URL patterns being matched. If you want to redirect to 
another web application, you need a fully-qualified redirect like this:

RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/f$ https://www.google.com/ [R,L]

-chris

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 21.03.22 um 06:39 schrieb rupali singh:
> Hi Felix,
>
> location of context.xml file is
>
>   cat context.xml| grep RewriteValve
>      <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
>   pwd
> /opt/tomcat/apache-tomcat-9.0.54/instance/conf
That context.xml is thought to be a default template for all installed 
webapps. It will work, but remember, that every installed webapp will 
get its own copy of a rewrite valve.
>
>
>
> more
> /opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
> RewriteCond %{QUERY_STRING} p=10001
> RewriteRule ^/apex/f$ /apex/myapp [R,L]

What happens, when you call the apex URL with curl? Something like

 > curl -D- 'localhost:8080/apex/f?p=10001'

It should display (assuming your tomcat listens on port 8080) something 
like:

HTTP/1.1 302
Location: /apex/myapp?p=10001
Content-Length: 0
Date: Mon, 21 Mar 2022 ...

Felix

>
> its still not working
>
>
> On Mon, 21 Mar 2022 at 00:57, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
>> Am 20.03.22 um 19:45 schrieb Thomas Hoffmann (Speed4Trade GmbH):
>>
>> Hello,
>>
>> url rewrite doesn't match against url parameters as far as I know.
>> RewriteRule ^/apex/f$  /apex/myapp [R,L]
>>
>> You can match the query string by adding a RewriteCond, for example
>>
>> RewriteCond %{QUERY_STRING} p=1001
>> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>>
>> (The lines have to be in that order and no other line in between)
>>
>> Felix
>>
>> Just a guess, maybe you can  give it a try.
>>
>> Another option would be to use the source code of tomcat and set a breakpoint within the filter class
>> (just with a little dummy app deployed).
>>
>> Greetings, Thomas
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: rupali singh<ru...@gmail.com>  <ru...@gmail.com>
>> Gesendet: Sonntag, 20. März 2022 19:23
>> An: Tomcat Users List<us...@tomcat.apache.org>  <us...@tomcat.apache.org>
>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>
>> Hi,
>>
>> i have referred Around here:https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>> but still can't figure out how to write rules for my requirements..
>> can you please help
>>
>> On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)<Th...@speed4trade.com.invalid>  <Th...@speed4trade.com.invalid>  wrote:
>>
>>
>> Hallo,
>>
>> just scroll down the documentation.
>> Around here:https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>> If something is not clear there, just drop a line
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: rupali singh<ru...@gmail.com>  <ru...@gmail.com>
>> Gesendet: Samstag, 19. März 2022 18:28
>> An: Tomcat Users List<us...@tomcat.apache.org>  <us...@tomcat.apache.org>
>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>
>> Hi,
>>
>> Thanks a lot for your quick response.then what options we have in
>> tomcat apache for rewrite rules.
>>
>> Apologies im new to apache tomcat.
>>
>>
>> On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian<te...@tmbsw.com>  <te...@tmbsw.com>
>> wrote:
>>
>>
>> On 3/19/2022 1:03 AM, rupali singh wrote:
>>
>> Hi Team,
>>
>> We are using tomcat 9.54 version.
>> Need help in rewriting rule.
>>
>> background   : We have an Oracle apex server ( version 21.1)  and
>>
>> tomcat
>>
>> is
>>
>> installed on the same server. We have F5 url which redirects to
>> apex installed on tomcat  eghttps://xyz.ae/apex/f?p=1001<https://xyz.com/apex/f?p=1001>  <https://xyz.com/apex/f?p=1001>    so xyz.ae is published on our F5
>>
>> which
>>
>> redirects internally to tomcat server on port 8080.
>>
>> we want to redirecthttps://xyz.ae/apex/f?p=1001<https://xyz.com/apex/f?p=1001>  <https://xyz.com/apex/f?p=1001>    to
>>    https://xyz.ae/apex/myapp  <https://xyz.com/aorx/myapp>  <https://xyz.com/aorx/myapp>    as it's
>>
>> difficult
>>
>> for business users to remember f?p=1001<https://xyz.com/apex/f?p=1001>  <https://xyz.com/apex/f?p=1001>
>>
>> i have prepared context.xml and rewrite.config rule but
>> redirection not working and there is no error in catalina.log
>>
>> in access log we are getting 404.
>>
>> i have tried steps mentioned in
>>
>>
>> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
>> -
>>
>> ord
>>
>> s-and-oracle-apex
>>
>> rewrite.config content
>>
>> RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$https://xyz.ae/apex/myapp  [R,L]
>>
>>
>> please advise how to resolve the issue
>>
>> Those look like Apache HTTPD rewrite rules. How are they supported
>> in Apache Tomcat?
>>
>> -Terence Bandoian
>>
>>
>> ------------------------------------------------------------------
>> --- To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail:users-help@tomcat.apache.org
>>
>>   --
>> Thanks and Regards,
>> Rupali
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail:users-help@tomcat.apache.org
>>
>>

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi Felix,

location of context.xml file is

 cat context.xml| grep RewriteValve
    <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
 pwd
/opt/tomcat/apache-tomcat-9.0.54/instance/conf



more
/opt/tomcat/apache-tomcat-9.0.54/instance/webapps/ROOT/WEB-INF/rewrite.config
RewriteCond %{QUERY_STRING} p=10001
RewriteRule ^/apex/f$ /apex/myapp [R,L]

its still not working


On Mon, 21 Mar 2022 at 00:57, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

>
> Am 20.03.22 um 19:45 schrieb Thomas Hoffmann (Speed4Trade GmbH):
>
> Hello,
>
> url rewrite doesn't match against url parameters as far as I know.
> RewriteRule ^/apex/f$  /apex/myapp [R,L]
>
> You can match the query string by adding a RewriteCond, for example
>
> RewriteCond %{QUERY_STRING} p=1001
> RewriteRule ^/apex/f$ /apex/myapp [R,L]
>
> (The lines have to be in that order and no other line in between)
>
> Felix
>
> Just a guess, maybe you can  give it a try.
>
> Another option would be to use the source code of tomcat and set a breakpoint within the filter class
> (just with a little dummy app deployed).
>
> Greetings, Thomas
>
>
> -----Ursprüngliche Nachricht-----
> Von: rupali singh <ru...@gmail.com> <ru...@gmail.com>
> Gesendet: Sonntag, 20. März 2022 19:23
> An: Tomcat Users List <us...@tomcat.apache.org> <us...@tomcat.apache.org>
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>
> Hi,
>
> i have referred Around here:https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> but still can't figure out how to write rules for my requirements..
> can you please help
>
> On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)<Th...@speed4trade.com.invalid> <Th...@speed4trade.com.invalid> wrote:
>
>
> Hallo,
>
> just scroll down the documentation.
> Around here:https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> If something is not clear there, just drop a line
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: rupali singh <ru...@gmail.com> <ru...@gmail.com>
> Gesendet: Samstag, 19. März 2022 18:28
> An: Tomcat Users List <us...@tomcat.apache.org> <us...@tomcat.apache.org>
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>
> Hi,
>
> Thanks a lot for your quick response.then what options we have in
> tomcat apache for rewrite rules.
>
> Apologies im new to apache tomcat.
>
>
> On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian<te...@tmbsw.com> <te...@tmbsw.com>
> wrote:
>
>
> On 3/19/2022 1:03 AM, rupali singh wrote:
>
> Hi Team,
>
> We are using tomcat 9.54 version.
> Need help in rewriting rule.
>
> background   : We have an Oracle apex server ( version 21.1)  and
>
> tomcat
>
> is
>
> installed on the same server. We have F5 url which redirects to
> apex installed on tomcat  eg https://xyz.ae/apex/f?p=1001<https://xyz.com/apex/f?p=1001> <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5
>
> which
>
> redirects internally to tomcat server on port 8080.
>
> we want to redirect  https://xyz.ae/apex/f?p=1001<https://xyz.com/apex/f?p=1001> <https://xyz.com/apex/f?p=1001>   to
>   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp> <https://xyz.com/aorx/myapp>   as it's
>
> difficult
>
> for business users to remember f?p=1001<https://xyz.com/apex/f?p=1001> <https://xyz.com/apex/f?p=1001>
>
> i have prepared context.xml and rewrite.config rule but
> redirection not working and there is no error in catalina.log
>
> in access log we are getting 404.
>
> i have tried steps mentioned in
>
>
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
> -
>
> ord
>
> s-and-oracle-apex
>
> rewrite.config content
>
> RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$https://xyz.ae/apex/myapp [R,L]
>
>
> please advise how to resolve the issue
>
> Those look like Apache HTTPD rewrite rules. How are they supported
> in Apache Tomcat?
>
> -Terence Bandoian
>
>
> ------------------------------------------------------------------
> --- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>  --
> Thanks and Regards,
> Rupali
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Thanks and Regards,
Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 20.03.22 um 19:45 schrieb Thomas Hoffmann (Speed4Trade GmbH):
> Hello,
>
> url rewrite doesn't match against url parameters as far as I know.
> RewriteRule ^/apex/f$  /apex/myapp [R,L]

You can match the query string by adding a RewriteCond, for example

RewriteCond %{QUERY_STRING} p=1001
RewriteRule ^/apex/f$ /apex/myapp [R,L]

(The lines have to be in that order and no other line in between)

Felix

>
> Just a guess, maybe you can  give it a try.
>
> Another option would be to use the source code of tomcat and set a breakpoint within the filter class
> (just with a little dummy app deployed).
>
> Greetings, Thomas
>
>> -----Ursprüngliche Nachricht-----
>> Von: rupali singh<ru...@gmail.com>
>> Gesendet: Sonntag, 20. März 2022 19:23
>> An: Tomcat Users List<us...@tomcat.apache.org>
>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>
>> Hi,
>>
>> i have referred Around here:
>> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>> but still can't figure out how to write rules for my requirements..
>> can you please help
>>
>> On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
>> <Th...@speed4trade.com.invalid>  wrote:
>>
>>> Hallo,
>>>
>>> just scroll down the documentation.
>>> Around here:
>>> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
>>> If something is not clear there, just drop a line
>>>
>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: rupali singh<ru...@gmail.com>
>>>> Gesendet: Samstag, 19. März 2022 18:28
>>>> An: Tomcat Users List<us...@tomcat.apache.org>
>>>> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
>>>>
>>>> Hi,
>>>>
>>>> Thanks a lot for your quick response.then what options we have in
>>>> tomcat apache for rewrite rules.
>>>>
>>>> Apologies im new to apache tomcat.
>>>>
>>>>
>>>> On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
>>>> <te...@tmbsw.com>
>>>> wrote:
>>>>
>>>>> On 3/19/2022 1:03 AM, rupali singh wrote:
>>>>>> Hi Team,
>>>>>>
>>>>>> We are using tomcat 9.54 version.
>>>>>> Need help in rewriting rule.
>>>>>>
>>>>>> background   : We have an Oracle apex server ( version 21.1)  and
>>> tomcat
>>>>> is
>>>>>> installed on the same server. We have F5 url which redirects to
>>>>>> apex installed on tomcat  eghttps://xyz.ae/apex/f?p=1001
>>>>>> <https://xyz.com/apex/f?p=1001>    so xyz.ae is published on our F5
>>>> which
>>>>>> redirects internally to tomcat server on port 8080.
>>>>>>
>>>>>> we want to redirecthttps://xyz.ae/apex/f?p=1001
>>>>>> <https://xyz.com/apex/f?p=1001>    to
>>>>>>    https://xyz.ae/apex/myapp  <https://xyz.com/aorx/myapp>    as it's
>>>>> difficult
>>>>>> for business users to remember f?p=1001
>>>>>> <https://xyz.com/apex/f?p=1001>
>>>>>>
>>>>>> i have prepared context.xml and rewrite.config rule but
>>>>>> redirection not working and there is no error in catalina.log
>>>>>>
>>>>>> in access log we are getting 404.
>>>>>>
>>>>>> i have tried steps mentioned in
>>>>>>
>>>>> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
>>>>> -
>>>> ord
>>>>> s-and-oracle-apex
>>>>>> rewrite.config content
>>>>>>
>>>>>> RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
>>>>>> https://xyz.ae/apex/myapp  [R,L]
>>>>>>
>>>>>>
>>>>>> please advise how to resolve the issue
>>>>> Those look like Apache HTTPD rewrite rules. How are they supported
>>>>> in Apache Tomcat?
>>>>>
>>>>> -Terence Bandoian
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------
>>>>> --- To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail:users-help@tomcat.apache.org
>>>>>
>>>>>
>>
>> --
>> Thanks and Regards,
>> Rupali
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail:users-help@tomcat.apache.org
>

AW: Fwd: tomcat 9.50 - rewrite rule question

Posted by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID>.
Hello,

url rewrite doesn't match against url parameters as far as I know.
RewriteRule ^/apex/f$  /apex/myapp [R,L]

Just a guess, maybe you can  give it a try.

Another option would be to use the source code of tomcat and set a breakpoint within the filter class
(just with a little dummy app deployed).

Greetings, Thomas

> -----Ursprüngliche Nachricht-----
> Von: rupali singh <ru...@gmail.com>
> Gesendet: Sonntag, 20. März 2022 19:23
> An: Tomcat Users List <us...@tomcat.apache.org>
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> 
> Hi,
> 
> i have referred Around here:
> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> but still can't figure out how to write rules for my requirements..
> can you please help
> 
> On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
> <Th...@speed4trade.com.invalid> wrote:
> 
> > Hallo,
> >
> > just scroll down the documentation.
> > Around here:
> > https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> > If something is not clear there, just drop a line
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: rupali singh <ru...@gmail.com>
> > > Gesendet: Samstag, 19. März 2022 18:28
> > > An: Tomcat Users List <us...@tomcat.apache.org>
> > > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> > >
> > > Hi,
> > >
> > > Thanks a lot for your quick response.then what options we have in
> > > tomcat apache for rewrite rules.
> > >
> > > Apologies im new to apache tomcat.
> > >
> > >
> > > On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian
> > > <te...@tmbsw.com>
> > > wrote:
> > >
> > > > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > > > Hi Team,
> > > > >
> > > > > We are using tomcat 9.54 version.
> > > > > Need help in rewriting rule.
> > > > >
> > > > > background   : We have an Oracle apex server ( version 21.1)  and
> > tomcat
> > > > is
> > > > > installed on the same server. We have F5 url which redirects to
> > > > > apex installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5
> > > which
> > > > > redirects internally to tomcat server on port 8080.
> > > > >
> > > > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > > > <https://xyz.com/apex/f?p=1001>   to
> > > > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> > > > difficult
> > > > > for business users to remember f?p=1001
> > > > > <https://xyz.com/apex/f?p=1001>
> > > > >
> > > > > i have prepared context.xml and rewrite.config rule but
> > > > > redirection not working and there is no error in catalina.log
> > > > >
> > > > > in access log we are getting 404.
> > > > >
> > > > > i have tried steps mentioned in
> > > > >
> > > > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with
> > > > -
> > > ord
> > > > s-and-oracle-apex
> > > > >
> > > > > rewrite.config content
> > > > >
> > > > > RewriteCond %{REQUEST_URI} ^/myapp$ RewriteRule ^/myapp$
> > > > > https://xyz.ae/apex/myapp [R,L]
> > > > >
> > > > >
> > > > > please advise how to resolve the issue
> > > >
> > > > Those look like Apache HTTPD rewrite rules. How are they supported
> > > > in Apache Tomcat?
> > > >
> > > > -Terence Bandoian
> > > >
> > > >
> > > > ------------------------------------------------------------------
> > > > --- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > > For additional commands, e-mail: users-help@tomcat.apache.org
> > > >
> > > >
> >
> 
> 
> --
> Thanks and Regards,
> Rupali

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi,

i have referred Around here:
https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
but still can't figure out how to write rules for my requirements..
can you please help

On Sat, 19 Mar 2022 at 21:57, Thomas Hoffmann (Speed4Trade GmbH)
<Th...@speed4trade.com.invalid> wrote:

> Hallo,
>
> just scroll down the documentation.
> Around here:
> https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
> If something is not clear there, just drop a line
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: rupali singh <ru...@gmail.com>
> > Gesendet: Samstag, 19. März 2022 18:28
> > An: Tomcat Users List <us...@tomcat.apache.org>
> > Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> >
> > Hi,
> >
> > Thanks a lot for your quick response.then what options we have in tomcat
> > apache for rewrite rules.
> >
> > Apologies im new to apache tomcat.
> >
> >
> > On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian <te...@tmbsw.com>
> > wrote:
> >
> > > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > > Hi Team,
> > > >
> > > > We are using tomcat 9.54 version.
> > > > Need help in rewriting rule.
> > > >
> > > > background   : We have an Oracle apex server ( version 21.1)  and
> tomcat
> > > is
> > > > installed on the same server. We have F5 url which redirects to apex
> > > > installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5
> > which
> > > > redirects internally to tomcat server on port 8080.
> > > >
> > > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > > <https://xyz.com/apex/f?p=1001>   to
> > > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> > > difficult
> > > > for business users to remember f?p=1001
> > > > <https://xyz.com/apex/f?p=1001>
> > > >
> > > > i have prepared context.xml and rewrite.config rule but redirection
> > > > not working and there is no error in catalina.log
> > > >
> > > > in access log we are getting 404.
> > > >
> > > > i have tried steps mentioned in
> > > >
> > > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-
> > ord
> > > s-and-oracle-apex
> > > >
> > > > rewrite.config content
> > > >
> > > > RewriteCond %{REQUEST_URI} ^/myapp$
> > > > RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
> > > >
> > > >
> > > > please advise how to resolve the issue
> > >
> > > Those look like Apache HTTPD rewrite rules. How are they supported in
> > > Apache Tomcat?
> > >
> > > -Terence Bandoian
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
>


-- 
Thanks and Regards,
Rupali

AW: Fwd: tomcat 9.50 - rewrite rule question

Posted by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID>.
Hallo,

just scroll down the documentation.
Around here: https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteRule
If something is not clear there, just drop a line


> -----Ursprüngliche Nachricht-----
> Von: rupali singh <ru...@gmail.com>
> Gesendet: Samstag, 19. März 2022 18:28
> An: Tomcat Users List <us...@tomcat.apache.org>
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> 
> Hi,
> 
> Thanks a lot for your quick response.then what options we have in tomcat
> apache for rewrite rules.
> 
> Apologies im new to apache tomcat.
> 
> 
> On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian <te...@tmbsw.com>
> wrote:
> 
> > On 3/19/2022 1:03 AM, rupali singh wrote:
> > > Hi Team,
> > >
> > > We are using tomcat 9.54 version.
> > > Need help in rewriting rule.
> > >
> > > background   : We have an Oracle apex server ( version 21.1)  and tomcat
> > is
> > > installed on the same server. We have F5 url which redirects to apex
> > > installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5
> which
> > > redirects internally to tomcat server on port 8080.
> > >
> > > we want to redirect  https://xyz.ae/apex/f?p=1001
> > > <https://xyz.com/apex/f?p=1001>   to
> > >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> > difficult
> > > for business users to remember f?p=1001
> > > <https://xyz.com/apex/f?p=1001>
> > >
> > > i have prepared context.xml and rewrite.config rule but redirection
> > > not working and there is no error in catalina.log
> > >
> > > in access log we are getting 404.
> > >
> > > i have tried steps mentioned in
> > >
> > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-
> ord
> > s-and-oracle-apex
> > >
> > > rewrite.config content
> > >
> > > RewriteCond %{REQUEST_URI} ^/myapp$
> > > RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
> > >
> > >
> > > please advise how to resolve the issue
> >
> > Those look like Apache HTTPD rewrite rules. How are they supported in
> > Apache Tomcat?
> >
> > -Terence Bandoian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >

Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi,

Thanks a lot for your quick response.then what options we have in tomcat
apache for rewrite rules.

Apologies im new to apache tomcat.


On Sat, Mar 19, 2022, 9:42 PM Terence M. Bandoian <te...@tmbsw.com> wrote:

> On 3/19/2022 1:03 AM, rupali singh wrote:
> > Hi Team,
> >
> > We are using tomcat 9.54 version.
> > Need help in rewriting rule.
> >
> > background   : We have an Oracle apex server ( version 21.1)  and tomcat
> is
> > installed on the same server. We have F5 url which redirects to apex
> > installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
> > redirects internally to tomcat server on port 8080.
> >
> > we want to redirect  https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   to
> >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> difficult
> > for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>
> >
> > i have prepared context.xml and rewrite.config rule but redirection not
> > working and there is no error in catalina.log
> >
> > in access log we are getting 404.
> >
> > i have tried steps mentioned in
> >
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
> >
> > rewrite.config content
> >
> > RewriteCond %{REQUEST_URI} ^/myapp$
> > RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
> >
> >
> > please advise how to resolve the issue
>
> Those look like Apache HTTPD rewrite rules. How are they supported in
> Apache Tomcat?
>
> -Terence Bandoian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

AW: Fwd: tomcat 9.50 - rewrite rule question

Posted by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID>.

> -----Ursprüngliche Nachricht-----
> Von: Terence M. Bandoian <te...@tmbsw.com>
> Gesendet: Samstag, 19. März 2022 17:11
> An: users@tomcat.apache.org
> Betreff: Re: Fwd: tomcat 9.50 - rewrite rule question
> 
> On 3/19/2022 1:03 AM, rupali singh wrote:
> > Hi Team,
> >
> > We are using tomcat 9.54 version.
> > Need help in rewriting rule.
> >
> > background   : We have an Oracle apex server ( version 21.1)  and tomcat is
> > installed on the same server. We have F5 url which redirects to apex
> > installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
> > redirects internally to tomcat server on port 8080.
> >
> > we want to redirect  https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   to
> >   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> difficult
> > for business users to remember f?p=1001
> > <https://xyz.com/apex/f?p=1001>
> >
> > i have prepared context.xml and rewrite.config rule but redirection
> > not working and there is no error in catalina.log
> >
> > in access log we are getting 404.
> >
> > i have tried steps mentioned in
> > https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-
> ord
> > s-and-oracle-apex
> >
> > rewrite.config content
> >
> > RewriteCond %{REQUEST_URI} ^/myapp$
> > RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
> >
> >
> > please advise how to resolve the issue
> 
> Those look like Apache HTTPD rewrite rules. How are they supported in
> Apache Tomcat?
> 
> -Terence Bandoian
> 

Supported rewrite rules are documented here:
https://tomcat.apache.org/tomcat-9.0-doc/rewrite.html#RewriteMap

Typical regular expressions, that’s why apache and tomcat look similar.

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 3/19/2022 1:03 AM, rupali singh wrote:
> Hi Team,
>
> We are using tomcat 9.54 version.
> Need help in rewriting rule.
>
> background   : We have an Oracle apex server ( version 21.1)  and tomcat is
> installed on the same server. We have F5 url which redirects to apex
> installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
> redirects internally to tomcat server on port 8080.
>
> we want to redirect  https://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>   to
>   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's difficult
> for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>
>
> i have prepared context.xml and rewrite.config rule but redirection not
> working and there is no error in catalina.log
>
> in access log we are getting 404.
>
> i have tried steps mentioned in
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
>
> rewrite.config content
>
> RewriteCond %{REQUEST_URI} ^/myapp$
> RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
>
>
> please advise how to resolve the issue

Those look like Apache HTTPD rewrite rules. How are they supported in 
Apache Tomcat?

-Terence Bandoian


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


Re: tomcat 9.50 - rewrite rule question

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Ripali,

On 3/20/22 14:13, rupali singh wrote:
> i have tried below but its not working
> 
> RewriteRule ^/apex/f?p=1001  /apex/myapp [R,L]

What is the context-path of your web application?

-chris

> On Sat, 19 Mar 2022 at 10:19, Jason Wee <pe...@gmail.com> wrote:
> 
>> have you try?
>>
>> RewriteRule ^/apex/f?p=1001  /apex/myapp [R,L]
>>
>> On Sat, Mar 19, 2022 at 2:05 PM rupali singh <ru...@gmail.com>
>> wrote:
>>>
>>> Hi Team,
>>>
>>> We are using tomcat 9.54 version.
>>> Need help in rewriting rule.
>>>
>>> background   : We have an Oracle apex server ( version 21.1)  and tomcat
>> is
>>> installed on the same server. We have F5 url which redirects to apex
>>> installed on tomcat  eg https://xyz.ae/apex/f?p=1001
>>> <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
>>> redirects internally to tomcat server on port 8080.
>>>
>>> we want to redirect  https://xyz.ae/apex/f?p=1001
>>> <https://xyz.com/apex/f?p=1001>   to
>>>   https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
>> difficult
>>> for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>
>>>
>>> i have prepared context.xml and rewrite.config rule but redirection not
>>> working and there is no error in catalina.log
>>>
>>> in access log we are getting 404.
>>>
>>> i have tried steps mentioned in
>>>
>> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
>>>
>>> rewrite.config content
>>>
>>> RewriteCond %{REQUEST_URI} ^/myapp$
>>> RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
>>>
>>>
>>> please advise how to resolve the issue
>>> --
>>> Thanks and Regards,
>>> Rupali
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 

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


Re: tomcat 9.50 - rewrite rule question

Posted by rupali singh <ru...@gmail.com>.
Hi,

i have tried below but its not working

RewriteRule ^/apex/f?p=1001  /apex/myapp [R,L]

On Sat, 19 Mar 2022 at 10:19, Jason Wee <pe...@gmail.com> wrote:

> have you try?
>
> RewriteRule ^/apex/f?p=1001  /apex/myapp [R,L]
>
> On Sat, Mar 19, 2022 at 2:05 PM rupali singh <ru...@gmail.com>
> wrote:
> >
> > Hi Team,
> >
> > We are using tomcat 9.54 version.
> > Need help in rewriting rule.
> >
> > background   : We have an Oracle apex server ( version 21.1)  and tomcat
> is
> > installed on the same server. We have F5 url which redirects to apex
> > installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
> > redirects internally to tomcat server on port 8080.
> >
> > we want to redirect  https://xyz.ae/apex/f?p=1001
> > <https://xyz.com/apex/f?p=1001>   to
> >  https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's
> difficult
> > for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>
> >
> > i have prepared context.xml and rewrite.config rule but redirection not
> > working and there is no error in catalina.log
> >
> > in access log we are getting 404.
> >
> > i have tried steps mentioned in
> >
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
> >
> > rewrite.config content
> >
> > RewriteCond %{REQUEST_URI} ^/myapp$
> > RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
> >
> >
> > please advise how to resolve the issue
> > --
> > Thanks and Regards,
> > Rupali
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

-- 
Thanks and Regards,
Rupali

Re: tomcat 9.50 - rewrite rule question

Posted by Jason Wee <pe...@gmail.com>.
have you try?

RewriteRule ^/apex/f?p=1001  /apex/myapp [R,L]

On Sat, Mar 19, 2022 at 2:05 PM rupali singh <ru...@gmail.com> wrote:
>
> Hi Team,
>
> We are using tomcat 9.54 version.
> Need help in rewriting rule.
>
> background   : We have an Oracle apex server ( version 21.1)  and tomcat is
> installed on the same server. We have F5 url which redirects to apex
> installed on tomcat  eg https://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>   so xyz.ae is published on our F5 which
> redirects internally to tomcat server on port 8080.
>
> we want to redirect  https://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>   to
>  https://xyz.ae/apex/myapp <https://xyz.com/aorx/myapp>   as it's difficult
> for business users to remember f?p=1001 <https://xyz.com/apex/f?p=1001>
>
> i have prepared context.xml and rewrite.config rule but redirection not
> working and there is no error in catalina.log
>
> in access log we are getting 404.
>
> i have tried steps mentioned in
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
>
> rewrite.config content
>
> RewriteCond %{REQUEST_URI} ^/myapp$
> RewriteRule ^/myapp$ https://xyz.ae/apex/myapp [R,L]
>
>
> please advise how to resolve the issue
> --
> Thanks and Regards,
> Rupali

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


Re: Fwd: tomcat 9.50 - rewrite rule question

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 19.03.22 um 07:03 schrieb rupali singh:
> Hi Team,
>
> We are using tomcat 9.54 version.
> Need help in rewriting rule.
>
> background   : We have an Oracle apex server ( version 21.1)  and tomcat is
> installed on the same server. We have F5 url which redirects to apex
> installed on tomcat  eghttps://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>    so xyz.ae is published on our F5 which
> redirects internally to tomcat server on port 8080.
>
> we want to redirecthttps://xyz.ae/apex/f?p=1001
> <https://xyz.com/apex/f?p=1001>    to
>   https://xyz.ae/apex/myapp  <https://xyz.com/aorx/myapp>    as it's difficult
> for business users to remember f?p=1001<https://xyz.com/apex/f?p=1001>

Are you sure, that you want to redirect the obscure URL - that is hard 
to remember - to redirect to a "sane" URL - that is easy to remember? I 
would do it the other way round. Tell the people to enter 
https://apex.ae/myapp (or apex.com/myapp) and let the app rewrite it to 
something hard to remember.

Felix

>
> i have prepared context.xml and rewrite.config rule but redirection not
> working and there is no error in catalina.log
>
> in access log we are getting 404.
>
> i have tried steps mentioned in
> https://stackoverflow.com/questions/38618473/tomcat-9-rewrite-with-ords-and-oracle-apex
>
> rewrite.config content
>
> RewriteCond %{REQUEST_URI} ^/myapp$
> RewriteRule ^/myapp$https://xyz.ae/apex/myapp  [R,L]
>
>
> please advise how to resolve the issue