Redirect Crowd Server Setup Page to Crowd WebApp Login Page
Purpose
If you need to redirect users accidentally going to the Crowd Server Setup page (accessed through <http://crowd-hostname:port>)
instead of Crowd WebApp Login page (accessed through <http://crowd-hostname:port/crowd>
), below are the steps to do it.
Solution
- Stop Crowd
Copy
urlrewritefilter-4.0.3.jar
FROM<crowd-install>/crowd-webapp/WEB-INF/lib/
TO<crowd-install>/apache-tomcat/lib/
- Copy
urlrewrite.xml
FROM<crowd-install>/crowd-webapp/WEB-INF/
TO<crowd-install>/apache-tomcat/webapps/ROOT/WEB-INF
- Update the file to contain only the following XML:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite
PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule enabled="true">
<from>/</from>
<to type="permanent-redirect">/crowd/</to>
</rule>
</urlrewrite>
- Modify
web.xml
found in<crowd-install>/apache-tomcat/webapps/ROOT/WEB-INF/
and replace the contents with the following:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>
<display-name>Crowd</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<filter>
<filter-name>url-rewrite</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>url-rewrite</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Start Crowd
Crowd Server Setup Page will automatically redirect the request to /crowd
To avoid browser caching, either test this using Incognito Mode/Private Browsing or clear your browser cache.
Status
After restarting you can visit http://127.0.0.1:8080/rewrite-status (or whatever the address of your local webapp and context) to see output (note: this page is only viewable from localhost).