0
Answered

How can I redirect an article?

chris.nicholson 2 years ago in Usability & Interface • updated by Vladimir Mullagaliyev (co-founder) 2 years ago 1

I have an article which has been replaced by more suitable content elsewhere. In case the UserEcho URL has been linked to from other websites, I would like to keep the URL active but setup a 301 redirect to the new content. Is there a way to do this?

Answer

Answer
Answered

Hello Chris,

You cannot do it in one click, but you still be able to do it via Custom JS script.

Open your project settings. Then "Custom CSS/JS", then "JS script".

Here add something like that (this is just an example):

<script>
// this method starts on documentLoaded event
initqueue.push(function(){
    // you can use JQuery here
    // check if this is topic view and topic id is what you need to redirect
    if ($("body.view-topic").length > 0 && $(".topic-item.topic-item-full").attr('data-topic-id') == "change_to_your_topic_id"){
    window.location.href='your_url_to_redirect';    
    }
})
</script>

We did not test this example, but it could work for you if you will replace a few places.

Answer
Answered

Hello Chris,

You cannot do it in one click, but you still be able to do it via Custom JS script.

Open your project settings. Then "Custom CSS/JS", then "JS script".

Here add something like that (this is just an example):

<script>
// this method starts on documentLoaded event
initqueue.push(function(){
    // you can use JQuery here
    // check if this is topic view and topic id is what you need to redirect
    if ($("body.view-topic").length > 0 && $(".topic-item.topic-item-full").attr('data-topic-id') == "change_to_your_topic_id"){
    window.location.href='your_url_to_redirect';    
    }
})
</script>

We did not test this example, but it could work for you if you will replace a few places.