# How to redirect to previous page after action?

**URL:** <https://forum.oxid-esales.com/t/how-to-redirect-to-previous-page-after-action/92842>\
**Category:** English forums\
**Tags:** dev-talk\
**Created:** [January 10, 2018, 10:04pm UTC](https://forum.oxid-esales.com/t/how-to-redirect-to-previous-page-after-action/92842 "2018-01-10T22:04:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rubbercut](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/rubbercut/32/3520_2.png) [@rubbercut](https://forum.oxid-esales.com/u/rubbercut)\
**Post date:** [January 11, 2018, 8:27am UTC](https://forum.oxid-esales.com/t/how-to-redirect-to-previous-page-after-action/92842/4 "2018-01-11T08:27:01Z")

</div>

1. Have a look at tobasket(…) and \_getRedirectUrl(). You simply can set before the return:

> ```
> $sUrl = $_SERVER['HTTP_REFERER'];
> oxRegistry::getUtils()->redirect($sUrl, false);
> 
> ```

or

> ```
> $sId = oxRegistry::getConfig()->getRequestParameter('anid');
> $oArticle = oxNew('oxArticle');
> $oArticle->load($sId);
> $sUrl = $oArticle->getLink();
> if($url)oxRegistry::getUtils()->redirect($sUrl, false);
> 
> ```

---

_[View the full topic](https://forum.oxid-esales.com/t/how-to-redirect-to-previous-page-after-action/92842)._
