Apache URL Rewriting Configuration for JIRA Service Desk Portal

I’m working with Atlassian JIRA Service Desk and need help with Apache URL rewriting. The default portal URL is quite long and hard for users to remember. I want to create a cleaner domain that redirects to the main portal but excludes certain paths.

Here’s what I need to achieve:

Main redirect:

http://support.company.com/ ---> http://jira.company.com/servicedesk/customer/portal/1

But these paths should be excluded:

http://support.company.com/static/styles.css ---> http://jira.company.com/static/styles.css
http://support.company.com/api/data ---> http://jira.company.com/api/data
http://support.company.com/login/page.html ---> http://jira.company.com/login/page.html

Basically I need the root domain to redirect to the service desk portal, but all other requests should pass through normally without the portal path. How can I write the Apache rewrite rules to handle this?

You can do this with a conditional rewrite rule that only targets the root path. Add this to your Apache virtual host config:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://jira.company.com/servicedesk/customer/portal/1 [R=301,L]

The ^/$ part only matches requests to the root directory. Static assets, API calls, and other paths won’t be affected - they’ll pass through to your backend server normally. Only bare domain requests get redirected to the service desk portal. I set up something similar for our internal ticketing system and it’s been solid without breaking anything else.

hey, that config sounds good! just make sure u test it out first after adding the rule. redirects can be tricky sometimes, but the pattern u mentioned should work for what u need. good luck with it!

I hit this same issue migrating our support portal. Conditional rewrites work, but I’d be more explicit about what gets redirected:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(static|api|login)
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://jira.company.com/servicedesk/customer/portal/1 [R=301,L]

That first condition explicitly excludes static assets, API endpoints, and login paths. Gives you better control and makes debugging way easier when you need to add more exclusions later. Pro tip: use R=302 while testing so browsers don’t permanently cache the redirect while you’re tweaking things.