This page is part of the documentation for a product called Confluence – nothing to do with mySpace.com redirection, sorry!
The {redirect} macro will automatically redirect the browser to an alternate web page either within your own site or on an external site...
There are several circumstances under which you may require this macro:
You have moved content to another space or site but people are still visiting the old location - the macro will automatically take them to the new location
You want to provide a static URL to some information that changes location occasionally - hand out the fixed URL and use the macro to automatically redirect the user to the current destination URL
The {redirect} macro has the following parameters:
{redirect:location|delay=time}
Parameters
Parameter
Required
Default
Notes
default
The default "location" parameter specifies the target destination - either a page title from your own site or an external URL.
delay
0
The amount of time to wait, in seconds, before automatically redirecting the user to the target page.
location
The external URL to redirect to.
When using this macro, please bear the following points in mind:
This macro does not keep track of whether the target page has had its name or URL changed and as such it's possible for the link to break
To edit a page which redirects instantly, manually add '?redirect=false' to the URL of the page that contains the redirect.
This macro uses JavaScript to redirect, so browsers with JavaScript turned off will require the user to manually click a link to take them to the target location.
This plug-in is available without cost for both commercial and non-commercial purposes. However, if you have found it to be useful, particularly within a commercial environment, please consider making a donation to the author. This will encourage continued development of this and other plug-ins, as well as speeding up the response for your latest maintenance request.
If you wish to donate, it can be done easily with a credit card or bank transfer using Paymate. No account sign-up is required for credit card payments.
This macro is compatible with Confluence 1.3.x, 1.4.x and 1.5.x. It has been tested by Adaptavist with Confluence 1.4.1, 1.4.3 and 1.4.4. It has been tested by David Peterson with Confluence 1.5-DR2.
This macro is usually pre-installed with Builder accounts. If you wish to install it on your own Confluence install, please download it from the RandomBits.org website.
Adaptavist maintain a JIRA Project for tracking bug reports and feature requests for this macro. The currently reported items are shown below:
jiraissues: Could not download[ http://jira.adaptavist.com/secure/IssueNavigator.jspa?view=rss&pid=10035&component=10030&statusIds=1&statusIds=3&statusIds=4&statusIds=5&sorter/field=updated&sorter/order=DESC&tempMax=25&reset=true&decorator=none] : caused by : Circular redirect to 'http://jira.adaptavist.com:80/secure/IssueNavigator.jspa'
To redirect to a local page in the same space, simply use the page title as the default parameter:
{redirect:Home}
When placed on to a page, any user visiting that page would be immediately taken to the home page of the same Space.
Redirecting to a page in another space
You can redirect to a page in a different space as follows:
{redirect:SpaceKey:Home}
This would immediately redirect to the page called "Home" in the space with key "SpaceKey".
This is quite useful if you want to immediately redirect anyone who accesses The Dashboard via the [USERGUIDE:Breadcrumb Trail] to a specific page within a specific space.
If you merely want to set a different home page for your Builder account, see our tutorial on setting a different Site Homepage. This would still allow people to access The Dashboard but when they first enter your site they would be taken to the home page of a specific space.
External locations
To redirect to an external location, simply specify it's URL. For example:
By default, the redirect will occur as soon as someone goes to the page that contains the macro. However, you can pause for a while (for example, to display a message explaining that the user should update their bookmarks, etc) by adding a delay:
Your bookmarks are out of date!
{redirect:http://adaptavist.com|delay=5}
This would display the following message for roughly 5 seconds then automatically redirect the user to the link specified:
Your bookmarks are out of date!
Redirection Notice This page should redirect to http://adaptavist.com in about X seconds.
As you can see, the redirect macro will also add a note macro to the page to ensure that if the browser doesn't have JavaScript enabled the user can click the link to the target page.
Changing an instant redirect
If your page is set to immediately redirect, you're obviously not going to have chance to edit the page should you wish to alter or remove the redirect!
To do this, you need to alter the URL to the page that contains the macro...
Start by getting the URL to the page - for example, the URL to the page you are looking at now is:
Tip:
If there is a page that links to the page containing the redirect, you can right-click the link and choose Copy Shortcut or Copy Link Location (depending on which web browser you use).
To temporarily disable the redirect, add "?redirect=false" to the end of the URL, so in our example the URL would become:
This URL would then display the page but disable the redirect, allowing you to edit the page to make any changes or even remove the redirect.
Hints and Tips
When you are first adding the macro to a page, set a delay of something like 20 seconds - this way, if there is a problem with the redirect, it's much easier to redisplay the page and edit it to fix the URL, etc. Once you are happy that the redirect is working, you can easily reduce or remove the delay.
Frequently Asked Questions
Q
I merely want to redirect to a page with a similar name, is there an easier way?
I am a myspace.com user, I want to redirect a page to another myspace page but the only code I have found uses "meta" and myspace doesnt allow that type of code. Is there an alternate way for me to redirect one myspace page (http:myspace/1) to another (http:myspace/2)?
Sorry, this documentation isn't anything to do with myspace.com – you'd have to ask the people who are in charge of that service for details on how to do redirects.
How to redirect on pages with parameters?
E.g. On my special NEWS space, I want to redirect space homepage to that space's news page (http:\//myurl/confluence/pages/viewrecentblogposts.action?key=NEWS).
However I get only redirect: Please provide a page or URL to redirect to. error and putting %3F instead of "?" doesn't help, too.
I was going to say use the {blog-posts} macro, but then realised that doesn't display the calendar at the site. Can you add a feature request to JIRA (see issue tracking tab at the top of this page) and we'll see if we can find out what's causing this to fail.
You can probably do something similar with Customware's Visibility plugin (the show-to macro and hide-from macro) although those particular macros are really buggy in the latest release of the Visibility plugin, hence us adding similar functionality to our Theme Builder plugin.
I have some users who want me to make a simple "E-mail Archives" link that shows up in our pagetree menu. I created the page, and used this macro to forward to the correct location:
Unfortunately we have two third-level domains for our content. If a user logs in to http://two.confluenceinstall.com and clicks on this link, s/he will be prompted for a login.
Is there any way to do relative urls with this macro?
I am a myspace.com user, I want to redirect a page to another myspace page but the only code I have found uses "meta" and myspace doesnt allow that type of code. Is there an alternate way for me to redirect one myspace page (http:myspace/1) to another (http:myspace/2)?
Sorry, this documentation isn't anything to do with myspace.com – you'd have to ask the people who are in charge of that service for details on how to do redirects.
How to redirect on pages with parameters?
E.g. On my special NEWS space, I want to redirect space homepage to that space's news page (http:\//myurl/confluence/pages/viewrecentblogposts.action?key=NEWS).
However I get only redirect: Please provide a page or URL to redirect to. error and putting %3F instead of "?" doesn't help, too.
I was going to say use the {blog-posts} macro, but then realised that doesn't display the calendar at the site. Can you add a feature request to JIRA (see issue tracking tab at the top of this page) and we'll see if we can find out what's causing this to fail.
Link to JIRA project is broken.
Thanks for bringing that to our attention - now fixed
Can this macro be used for conditionnal redirect ?
What I need is the following:
Can this macro do the job ?
Thank you !
–
Mickaël Rémond
http://www.process-one.net/
Updated by Guy Fraser
Jul 21, 2008 19:00
If you've got Theme Builder 3.0.0 or higher installed, use builder-show and builder-hide:
{builder-show:group=confluence-users} {redirect ...private space...} {builder-show} {builder-hide:group=confluence-users} {redirect ...public space...} {builder-hide}You can probably do something similar with Customware's Visibility plugin (the show-to macro and hide-from macro) although those particular macros are really buggy in the latest release of the Visibility plugin, hence us adding similar functionality to our Theme Builder plugin.
I have some users who want me to make a simple "E-mail Archives" link that shows up in our pagetree menu. I created the page, and used this macro to forward to the correct location:
{redirect:location=http://one.confluenceinstall.com/spaces/viewmailarchive.action?key=GROUP}Unfortunately we have two third-level domains for our content. If a user logs in to http://two.confluenceinstall.com and clicks on this link, s/he will be prompted for a login.
Is there any way to do relative urls with this macro?
I have a problem to edit pages that include the redirect macro.
)
My page URL does not follow the scheme
http://www.adaptavist.com/display/USERGUIDE/redirect+macro
but looks something like
http://XXX.XXXYYYY.de/confluence/pages/viewpage.action?pageId=12847705
(i guess because the page title is a long german phrase full of special characters
and because of this structure the "?redirect=false" after the URL does not seem to work and i cant access the page in edit mode at all ...
any idea how to deal with this?
thanks in advance,
Arne