I have migrated the one server (http://server_old) confluence to the other server (http://server_new), now i am required to do redirection to the new server when people type in the old server confluence address with any page
example case: http://server_old/any_space/any_page => http://server_new/any_space/any_page)
May i know is there anyway to do this?
Thanks in advanced.
Not in the application, but there's options.
If you're running it behind something like Apache, then that can easily do rewrites or redirects.
You could do it with network config too, simply mapping DNS so that the old server name resolves to the new one.
The Tomcat running Confluence might be capable of redirecting too, although I'm not sure (and I don't know that you're actually on Tomcat either - look for the docs on whatever application server you are running)
As a last option, write a short web-application that replaces Confluence and redirects if users land on it.
Stumbled across this in a Google search...not sure if it's been answered already elsewhere, but I figured I'd offer what I used to fix it (mostly).
Confluence (at least in v5.3.1) comes with a jar called URLRewrite, which the Confluence server uses for its own purpose. Using that plugin, some DNS wizardry, and the instructions here: http://tuckey.org/urlrewrite/it's possible to set up a redirect so that when someone requests server_old, they hit your new server's Tomcat server though the DNS entry, their URL is rewritten, and the url that shows up is server_new.
The word "mostly" is because while this works well for people who visit the root of the Confluence page, I'm still working out the scenario where the user had a full link (short or long) as the links are being redirected to the home page right now. Since I'm mostly Windows/IIS, this Tomcat stuff isn't so natural, so perhaps there's a way to adjust Tomcat's redirect rules to that end. I'm still hacking away at it, but if I find out what the fix is on that, I'll reply appropriately.
To follow-up, here's what we ended up doing that worked.
1) In the %install_dir%\confluence\Web-Inf\web.xml file - put the following as the first filter in the list of filters
2) In the %install_dir%\confluence\Web-Inf\urlrewrite.xml file, add the following at the bottom of the doc, right before the </urlrewrite> tag:
<condition name="host" operator="notequal">^server_new</condition>
<condition name="host" operator="notequal">^localhost</condition>
<condition type="port" operator="equal">port Tomcat server is running on</condition>
<to type="permanent-redirect" last="true">http://server_new/$1</to>
If you are running Confluence over SSL, then you will need two of the above rules, one for each port Tomcat has open (defaults of 8090 and 8443). The $1 is extremely important; without it, tiny links with server_old as the server will redirect to the root of the Confluence instance instead of the desired page.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot