Purpose
This article discusses one option for configuring custom URLs for the JIRA Service Desk customer portal. This will allow you to provide a simple URL that customers can use to access the portal.
- This solution applies to the Server version of JIRA Service Desk 3.0+
- This solution will not work in older versions and is not available in JIRA Cloud.
- This solution will not work in older versions and is not available in JIRA Cloud.
Steps for Configuring Alternate URLs
This method uses the Rerwrite Valve that was introduced in Tomcat 8.
- Tomcat 8 is the application server included in JIRA 7.0+ and JIRA Service Desk 3.0+. Older versions used Tomcat 7 so this solution will not work prior to JIRA 7.0 and Service Desk 3.0.
Step 1: Configure Rewrite Valve
First you will need to tell Tomcat that it should use the Rewrite Valve. The simplest way is to do the following:
- Edit
JIRA_INSTALL/conf/context.xml
- Add the following line to this file. Place this above the line containing
</Context>
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
Be sure to save the file after making the change. This change will take effect after JIRA is restarted.
- Before restarting JIRA, proceed to step 2 and configure your rewrite rules
Step 2: Create Rewrite Configuration File
Rewrite rules are configured in a rewrite.config
file that you will need to create. This file is placed in the JIRA_INSTALL/atlassian-jira/WEB-INF
directory.
- Create a file named
rewrite.config
and place it in theJIRA_INSTALL/atlassian-jira/WEB-INF
directory.- The final path should be
JIRA_INSTALL/atlassian-jira/WEB-INF/rewrite.config
The user that JIRA runs as must be able to read this file. This file should have the same permissions as the other files in
WEB-INF
directory.
- The final path should be
Step 3: Add Rewrite Rules
The rewrite.config
file is where you define the rewrite conditions and rules. RewriteCond and RewriteRule are discussed in the Tomcat Rewrite Valve Documentation.
Redirecting Subdomain to Customer Portal
The following example will redirect requests sent to "support.domain.com" to the customer portal located at "jira.domain.com"
RewriteCond %{HTTP_HOST} ^support\.domain\.com$ [NC] RewriteRule ^(.*)$ http://jira.domain.com/servicedesk/customer/portals [R=301,L]
Redirecting Multiple Subdomains to Customer Portal
The following example will redirect requests sent to "subdomain1.domain.com" and "subdomain2.domain.com" to the customer portal located at "jira.domain.com"
RewriteCond %{HTTP_HOST} ^(subdomain1|subdomain2)\.domain\.com$ [NC] RewriteRule ^(.*)$ http://jira.domain.com/servicedesk/customer/portals [R=301,L]
Redirecting Subdomain to Specific Service Desk Portal
The following example will redirect requests sent to "desktopsupport.domain.com" to the desktop support customer portal which is located on "jira.domain.com" and has ID "2"
RewriteCond %{HTTP_HOST} ^desktopsupport\.domain\.com$ [NC] RewriteRule ^(.*)$ http://jira.domain.com/servicedesk/customer/portal/2 [R=301,L]
Redirecting Subdomain to Specific Request Type Form
The following example will redirect requests sent to "helprequest.domain.com" to the request type form with ID "4" which is located in the service desk portal with ID "2"
RewriteCond %{HTTP_HOST} ^helprequest\.domain\.com$ [NC] RewriteRule ^(.*)$ http://jira.domain.com/servicedesk/customer/portal/2/create/4 [R=301,L]
Alternate Methods
This is only one method of configuring an alternate URL. Other methods include the use of a proxy server, such as Apache or Nginx, to rewrite the URLs.