Redirect Crowd Server Setup Page to Crowd WebApp Login Page

Still need help?

The Atlassian Community is here for you.

Ask the community

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:
urlrewrite.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: 


web.xml
<?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 

tip/resting Created with Sketch.

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).



Last modified on Oct 13, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.