Redirection in Confluence 4
Asked by Jussi Savolainen:

Hi,

What would be the preferred way to implement a redirect from a page to an external source in Confluence 4? I'm not finding the "redirect" macro, perhaps it's not part the new version anymore? Confluence newbie here so bare with me... thanks!

Jussi

EDIT:  
So I found these but none is for Confluence 4

<https://plugins.atlassian.com/plugin/details/183>

<https://plugins.atlassian.com/plugin/details/22940>


Answers:
author: David at David Simpson Apps
body: It should be pretty easy to do this as a user macro using JavaScript -- if that's deemed acceptable.

Something like this...

```
## Macro title: Redirect## Macro has a body: N## Body processing: No macro body## Output: Selected output option#### Developed by: David Simpson## Date created: 2011-10-12## Installed by: My Name## This is an example macro## @param url:title=URL|type=string|required=true|desc=The external webpage to redirect toRedirecting to: &lt;a id="redirectMe" href="$paramurl"&gt;$paramurl&lt;/a&gt;&lt;script&gt;  AJS.toInit(function(){    window.location.replace( AJS.$('#redirectMe').attr('href') );  });&lt;/script&gt;
```

You'll have fun trying to edit the page after doing this though, so maybe add a setTimeout option :)

comments: author: Jussi Savolainen
body: Thanks! Yes I thought I have to go with the JS option for now on (until a proper plugin appears... and perhaps with an option that admins won't get redirected to the new place to avoid the problem you mentioned:)


author: David Peterson
body: Hey there, we will be updating Redirect to work 'natively' with 4.0, but no timeline currently. Hopefully not too long, but keep an eye on [community.customware.net](http://community.customware.net) for updates.


author: Bob Swift (personal)
body: Redirect macro probably works, but plugin needs to be installed manually (download/upload) until the plugin exchange shows a compatible version.

comments: author: Jussi Savolainen
body: Tried with this one:

<https://plugins.atlassian.com/plugin/details/183>

Installs ok but won't recognize macro.

EDIT:

And with this one:

<https://plugins.atlassian.com/plugin/details/22940>

Again, installs ok (at least no visible errors on the admin interface), but the forward rules not working. Perhaps wiser to wait for the official version for C4...


author: Matt
body: Try inserting the markup for the macro using the Wiki Markup Dialog via the Insert menu. It may still work despite not yet being updated to support 4.0 -- i9.e. not recogized by the Macro Browser and Macro Autocomplete.


author: Jussi Savolainen
body: Thanks! This works indeed (with this plugin <https://plugins.atlassian.com/plugin/details/183>)


author: Bob Swift (personal)
body: Matt, there is some confusion about the difference between migration mode and fully compatible mode for plugins. It would be helpful if there was some documentation that described for end users how to deal with that. It was really nice for migration that Confluence supported migrated macros but there are lots of gotchas for end users - like your comment above. Specifically, many plugins will work whether or not they have been marked as compatible in the plugin exchange. Marking them compatible, means they can be installed via UPM and used, but may not be upgraded to fully support usage outside of via wiki markup. So instead of 2 choices - it works/doesn't work, there are 3 - it works in migration mode, it works in 4.0 mode, or it doesn't work at all. Unfortunately, there is no easy way to tell the difference. I have tried to head off user difficulties for some of my plugins via [Confluence 4.0 compatibility for Table and other plugins](https://studio.plugins.atlassian.com/wiki/display/TBL/2011/09/19/Confluence+4.0+compatibility+for+Table+and+other+plugins)


author: Migration Bot 9000
body: Thanks Bob for the reply. Just a clarification.

Our approach with 4.0 is to ensure that macros in existing content continue to work after the upgrade to 4.0.

The use case in this discussion thread is around insertion of macros in new content created after the upgrade. For a macro to appear in autocomplete or in the macro browser, a plugin author must update their plugin. Documentation on how do this can be found [here](http://confluence.atlassian.com/display/CONF30/Updating+macros+for+the+Macro+Browser). These instructions have been available since Confluence 3.0, and we encourage all plugin authors to make this change.

Most macros marked as 3.5.x compatible on the plugin exchange should work in 4.0. However, as Bob mentioned, to insert them, you'll need to use the "Insert Wiki Markup Dialog".

comments: author: Bob Swift (personal)
body: Dave, my comment wasn't about plugin authors, but, how general admins/users figure out how migration mode works and the limitations with that. Admins have no way of knowing which is which for macros.


author: Migration Bot 9000
body: Bob,

If a plugin is marked as only 3.5.x on PAC, the implication for an administrator is that it most likely will work in what you define as "migration mode" and insertable via the "Insert Wiki Markup Dialog".

A plugin marked as 4.0.x compatible on PAC will work and should be insertable via autocomplete and the macro browser.

Admittedly, this is is not enforced on PAC.


author: Bob Swift (personal)
body: Probably not the place for this discussion, but, I was not aware of any guidance provided on this. I mark 4.0 compatible once it successfully is tested on Confluence 4.0 in migration mode. This enables easy UPM install when testing migration, etc.... UPM doesn't have an option to easily find/install plugins that are not marked compatible.


Tags: redirect