# How can you redirect a user to previous page after the registration?

**URL:** <https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634>\
**Category:** Programmierung\
**Created:** [17. August 2017 um 08:07 UTC](https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634 "2017-08-17T08:07:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ertuzio](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@ertuzio](https://forum.shopware.com/u/ertuzio)\
**Post date:** [17. August 2017 um 08:07 UTC](https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634/1 "2017-08-17T08:07:54Z")

</div>

I have made a custom plugin which disables article reviewing for unregistered users and instead of showing the input form there is a button „Review a product“ which is linked to Registration.

And what I want to know is:

How to redirect the user back to visited product after successfull registration?

---

<div class="post-metadata">

**Author:** ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)\
**Post date:** [17. August 2017 um 08:26 UTC](https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634/2 "2017-08-17T08:26:01Z")

</div>

Hi ertuzio,

the loginAction of the account controller takes two parameters.&nbsp;[shopware/Account.php at 5.3 · shopware/shopware · GitHub](https://github.com/shopware/shopware/blob/5.3/engine/Shopware/Controllers/Frontend/Account.php#L264)  
After succesful login, this is the page, where the user will be redirected to. If the two parameters ‚sTarget‘ (controller name) and ‚sTargetAction‘ are not set, the user gets redirected to the account page.&nbsp;  
You can provide these two parameters to redirect where ever you like after the login.&nbsp;

Best regards from Schöppingen

![cool](http://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/shopware.png "cool")&nbsp;Michael Telgmann

---

<div class="post-metadata">

**Author:** ![maxkon](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@maxkon](https://forum.shopware.com/u/maxkon)\
**Post date:** [17. August 2017 um 08:33 UTC](https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634/3 "2017-08-17T08:33:28Z")

</div>

Hello ertuzio,

Just wanted to add, that even though Michael Telgmann described it perfectly, you still could purchase/test a plugin-in the shopware store, which does the job for you.

Just in case you want to save yourself some work time. ![Wink](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/wink.png "Wink")

[http://store.shopware.com/en/comer91460192123/return-back-after-login.html](http://store.shopware.com/en/comer91460192123/return-back-after-login.html)

We used it on our most recent e-commerce solution and it does the job

&nbsp;

Kind regards,

Max K

&nbsp;

Edit: Accidently added the link to the german shopware store page

---

<div class="post-metadata">

**Author:** ![langnickel](https://avatars.discourse-cdn.com/v4/letter/l/3ec8ea/32.png) [@langnickel](https://forum.shopware.com/u/langnickel)\
**Post date:** [12. Oktober 2018 um 10:08 UTC](https://forum.shopware.com/t/how-can-you-redirect-a-user-to-previous-page-after-the-registration/47634/4 "2018-10-12T10:08:52Z")

</div>

> You can provide these two parameters to redirect where ever you like after the login.&nbsp;
> 
> &nbsp;
> 
> ![cool](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/86c57fbace799dd4eb1f1b8a2d3bdc1733f0aea1.png "cool")&nbsp;Michael Telgmann

Not exactly. You cannot redirect to a product detail because sTarget=detail and sTargetAction=index but the missing paramter sArticle=… gets ommited from the loginAction&nbsp;
