Bug 1262942

Summary: Rewrite rule is not working in Jboss EAP 6.4.0
Product: [JBoss] JBoss Enterprise Portal Platform 6 Reporter: sudiptasarkar <sudiptasarkar>
Component: PortalAssignee: Nobody <nobody>
Status: CLOSED NOTABUG QA Contact: Tomas Kyjovsky <tkyjovsk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aogburn, epp-bugs, sudiptasarkar
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-26 11:49:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sudiptasarkar 2015-09-14 16:53:34 UTC
Description of problem:


Version-Release number of selected component (if applicable):

Jboss EAP 6.4.0


How reproducible:

The following reqrite rule works in Jboss 7.1.1-Final but doesn't work in Jboss EAP 6.4.0

<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false">
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
            <virtual-server name="default-host" enable-welcome-root="false">
                <alias name="localhost"/>
                <alias name="example.com"/>
		<rewrite pattern="^/portal/(.*?)$" substitution="/core/$1" flags="R"/>
            </virtual-server>
        </subsystem>

Steps to Reproduce:
http://localhost:myport/portal/ returns 404

Actual results:

http://localhost:myport/portal/ returns 404

Expected results:

Redirect to http://localhost:myport/core/

Additional info:

Comment 2 Aaron Ogburn 2016-06-22 17:51:38 UTC
Do you have a / or /portal context deployed?  If not, the 404 would be expected because there is no context to serve the original portal request.  Thus the global rewrite valve would not be executed because a 404 is generated before the valve is reached.  See https://access.redhat.com/solutions/733363.

You should set enable-welcome-root="true", or deploy a ROOT.war or portal.war for the rewrite valve to be executed for that request.

Comment 4 Red Hat Bugzilla 2023-09-14 03:05:16 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days