Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo tomcat url rewrite

 I add url write rule successfully for JIRA and Stash. But failed for Bamboo and Confluence. It just doesn't work. Not sure why it's different for Bamboo. Can someone advise here. Thanks.

Below rule was added into urlwrite.xml as TOP RULE under WEB-INF folder

 <rule>                   

          <condition name="host" operator="notequal">host.adc.com</condition>

           <from>^/(.*)</from>

           <to type="permanent-redirect" last="true">http://host.abc.com/$1</to>

  </rule>

2 answers

1 vote
Deleted user Mar 09, 2015

Changes to the urlrewrite file work with JIRA and Stash, but require additional changes in the web.xml (same directory) for Confluence and Bamboo. For the latter, the web.xml contains filter mappings that will cause your UrlRewriteFilter to not be accessed.

Look for UrlRewriteFilter with the url-pattern of /s/* and remove the /s. That will cause /* to be redirected to your rewrite filter and should solve the problem.

-Todd

Changming

Can you provide the details on how you got the URLRewrite filter to work for Jira, I was able to get it to work for Confluence but can't get it to for Jira. Not sure if I'm missing a line or a parameter somewhere in either the Urlrewrite.xml or web.xml files.

Thanks

Roger

Roger,

It's important to check both web.xml files.  Assuming a default installation, one is in Program Files\Atlassian\JIRA\conf and the other is in Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF.  You should check both for the pattern that Todd mentioned above.

For our URL Rewrite, we have a handful of various clauses to handle each possible way our users attempt to access the system.  It's not the prettiest but it works.  See a few example rules below:

This rule redirects the user if they just type in jira/ or if they are already using https.

<rule>
<name>Redirect Https/Shorthand</name>
<condition type="server-name" operator="notequal">^[0-9.]+$</condition>
<condition name="host" operator="notequal">jira.<ourdomain>.com</condition>
<condition type="scheme" operator="equal">https</condition>
<from>^/(.*)$</from>
<to type="redirect" qsappend="true">https://jira.<ourdomain>.com/$1</to>
</rule>

This rule validates whether or not the fully qualified domain is requested.
<rule>
<name>Domain Name Check</name>
<condition type="server-name" operator="notequal">^[0-9.]+$</condition>
<condition name="host" operator="notequal">jira.<ourdomain>.com</condition>
<condition type="scheme" operator="notequal">https</condition>
<from>^/(.*)$</from>
<to type="redirect" qsappend="true">https://jira.<ourdomain>.com/$1</to>
</rule>

This rule redirects non https requests to https ones.

<rule>
<name>FQDN NOT HTTPS</name>
<condition type="server-name" operator="notequal">^[0-9.]+$</condition>
<condition name="host" operator="equal">jira.<ourdomain>.com</condition>
<condition type="scheme" operator="notequal">https</condition>
<from>^/(.*)$</from>
<to type="redirect" qsappend="true">https://jira.<ourdomain>.com/$1</to>
</rule>

If you google tuckey URL rewrite there's some documentation available.  Note that all of these rules evaluate in sequence so each of our rules take care of an edge case.  Remember that you've reached these filters after DNS has already pointed you to the right server, so in our case we use the URL rewrite to handle improperly formatted URL's

Aside from that, we're not doing anything else.  If you could post your urlrewrite file that might help.

Regards,

Stuart

Hi Stuart

Thanks for your reply....

I got it working as it turns out I had a few items in the URLRewrite.xlm file that were not right. This what I now have in the file.

<urlrewrite>
 <rule>
        <name>Domain Name Check</name>
  <condition name="host" operator="notequal">jirademo.mydomain.com</condition>
  <from>^(.*)$</from>
  <to type="redirect">http://jirademo.mydomain.com$1</to>
    </rule>
    <!-- Caching of static resources -->
   
 <class-rule class="com.atlassian.jira.plugin.webresource.CachingResourceDownloadRewriteRule"/>
   
 <!-- @since 5.0 [KickAss]-->
     <rule>
        <from>^/issues(\?.*)?$</from>
        <to type="permanent-redirect">issues/$1</to>
    </rule>
</urlrewrite>

I had to remove a few lines from the Web.xml file related to the URLRewrite filter in the Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF folder. These lines are required for the Urlrewrite filter in Confluence but not for Jira.

<filter-mapping>
  <filter-name>UrlRewriteFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>FORWARD</dispatcher>
 </filter-mapping

 

Regards

Roger

I got Confluence working by doing /* for UrlRewriteFilter, but Bamboo doesn't have this line. Anything else I should check?

Also, I can't redirect HTTP to HTTPS neither wit Bamboo

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

251 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you