Rulerewrite is not working in TomEE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rulerewrite is not working in TomEE

Patabandula, Gangadhar

All,

 

I am configuring a maintenance page for my application to block users accessing the application during maintenance window.

 

I have configured below valve in context.xml as attached.

 

<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />

 

I have created rewrite.config file as attached with below rule.

 

RewriteRule ^/home/.*$ /maintenance.html [L]

 

Now I restarted TomEE.

 

When I accessed http://localhost/  I am getting block page where I am expecting server admin page

When I accessed http://localhost/home/  I am getting block page where I am expecting maintenance.html page.

 

Could anyone help me solve the issue.

 

Regards,

Gangadhar.

 

Notice - The information and attachment(s) contained in this communication are intended for the addressee only, and may be confidential and/or legally privileged. If you have received this communication in error, please contact the sender immediately, and delete this communication from any computer or storage system. Any interception, review, printing, copying, re-transmission, dissemination, or other use of, or taking of any action upon this information by persons or entities other than the intended recipient is strictly prohibited by law and may subject them to criminal or civil liability. No LTCG companies shall be liable for the improper and/or incomplete transmission of the information contained in this communication or for any delay in its receipt.

context.xml (2K) Download Attachment
server.xml (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Rulerewrite is not working in TomEE

Romain Manni-Bucau
Hi,

this works on tomee 7.0.4 (note your comet valve is not provided in tomee
so you have to remove it to deploy your application I think)

ensure you put rewrite.config in WEB-INF and context.xml in META-INF of the
war maybe.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>

2018-03-05 23:51 GMT+01:00 Patabandula, Gangadhar <
[hidden email]>:

> All,
>
>
>
> I am configuring a maintenance page for my application to block users
> accessing the application during maintenance window.
>
>
>
> I have configured below valve in context.xml as attached.
>
>
>
> <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
>
>
>
> I have created rewrite.config file as attached with below rule.
>
>
>
> RewriteRule ^/home/.*$ /maintenance.html [L]
>
>
>
> Now I restarted TomEE.
>
>
>
> When I accessed http://localhost/  I am getting block page where I am
> expecting server admin page
>
> When I accessed http://localhost/home/  I am getting block page where I
> am expecting maintenance.html page.
>
>
>
> Could anyone help me solve the issue.
>
>
>
> Regards,
>
> Gangadhar.
>
>
> Notice - The information and attachment(s) contained in this communication
> are intended for the addressee only, and may be confidential and/or legally
> privileged. If you have received this communication in error, please
> contact the sender immediately, and delete this communication from any
> computer or storage system. Any interception, review, printing, copying,
> re-transmission, dissemination, or other use of, or taking of any action
> upon this information by persons or entities other than the intended
> recipient is strictly prohibited by law and may subject them to criminal or
> civil liability. No LTCG companies shall be liable for the improper and/or
> incomplete transmission of the information contained in this communication
> or for any delay in its receipt.
>
Reply | Threaded
Open this post in threaded view
|

Re: Rulerewrite is not working in TomEE

jgallimore
In reply to this post by Patabandula, Gangadhar
What version of TomEE are you using?

Jon

On Mon, Mar 5, 2018 at 10:51 PM, Patabandula, Gangadhar <
[hidden email]> wrote:

> All,
>
>
>
> I am configuring a maintenance page for my application to block users
> accessing the application during maintenance window.
>
>
>
> I have configured below valve in context.xml as attached.
>
>
>
> <Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
>
>
>
> I have created rewrite.config file as attached with below rule.
>
>
>
> RewriteRule ^/home/.*$ /maintenance.html [L]
>
>
>
> Now I restarted TomEE.
>
>
>
> When I accessed http://localhost/  I am getting block page where I am
> expecting server admin page
>
> When I accessed http://localhost/home/  I am getting block page where I
> am expecting maintenance.html page.
>
>
>
> Could anyone help me solve the issue.
>
>
>
> Regards,
>
> Gangadhar.
>
>
> Notice - The information and attachment(s) contained in this communication
> are intended for the addressee only, and may be confidential and/or legally
> privileged. If you have received this communication in error, please
> contact the sender immediately, and delete this communication from any
> computer or storage system. Any interception, review, printing, copying,
> re-transmission, dissemination, or other use of, or taking of any action
> upon this information by persons or entities other than the intended
> recipient is strictly prohibited by law and may subject them to criminal or
> civil liability. No LTCG companies shall be liable for the improper and/or
> incomplete transmission of the information contained in this communication
> or for any delay in its receipt.
>