# Redirect to a specific page after Member Log In

**URL:** <https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545>\
**Category:** Ask the community\
**Tags:** wix-members-area, cms, wix, wix-studio, code\
**Created:** [April 7, 2026, 4:37pm UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545 "2026-04-07T16:37:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skyesj](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Skyesj](https://forum.wixstudio.com/u/Skyesj)\
**Post date:** [April 7, 2026, 4:37pm UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/1 "2026-04-07T16:37:22Z")

</div>

**When a member logs in, I want to direct them to a specific page.**  
The code only works from the public pages (the default domain URL which I have masked below).  
**Working in**  
e.g. Wix Studio Editor, Wix Editor, Dev Mode, CMS, etc.

**Site link**  
If this is happening on a site, include a live or test site link

**What I’m trying to do**  
From a prior post, I posted some code into the site and it works GREAT all but one important part.

Here is the code; the masked section is the Domain Name followed by the desired default member log in page (Let’s call it page 1).

 ![image](https://us1.discourse-cdn.com/wix/original/3X/3/6/3607574ac717bb615eae43c3b8b7a1c3e34b027e.png)

If the member is on a public page before logging on, it works great . But I have ten pages under the member log in menu. If the user logs out on say page 7, when they log back in it remembers where they were and takes them to page 7 - instead of the desired Page 1 of the Member log in menu. How do I modify this code to happen on all volunteer pages (2-10)? Thank you so much for your help. I am not a coder…. Sjj

**What I’ve tried so far**  
Let us know what you’ve already tested, changed, or searched

**Extra context**  
Anything else that might help - edge cases, screenshots, etc.

---

<div class="post-metadata">

**Author:** ![Dan\_Suhr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dan_suhr/32/94074_2.png) [@Dan\_Suhr](https://forum.wixstudio.com/u/Dan_Suhr)\
**Post date:** [April 7, 2026, 11:41pm UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/2 "2026-04-07T23:41:22Z")

</div>

try this - replace “/page-1” with the url of the page you want.

For example, if the full page URL is:

`https://www.yourdomain.com/volunteer-home`

then use:

`wixLocation.to("/volunteer-home");`

```javascript
import { authentication } from 'wix-members-frontend';
import wixLocation from 'wix-location-frontend';

$w.onReady(function () {
    authentication.onLogin(() => {
        wixLocation.to("/page-1");
    });
});

```

---

<div class="post-metadata">

**Author:** ![Skyesj](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Skyesj](https://forum.wixstudio.com/u/Skyesj)\
**Post date:** [April 8, 2026, 8:48pm UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/3 "2026-04-08T20:48:09Z")

</div>

![image](https://us1.discourse-cdn.com/wix/original/3X/1/8/18af56f5166071dc6ecbf57a462fe3d239c04ac9.png)  
So I made the change - and it works the same and I am now getting a lot of run errors -  
See this:

 ![image](https://us1.discourse-cdn.com/wix/original/3X/0/3/03f5d5454768ad3049323cffafcca07ba868eccf.png)

I have determined that if the user X’s out of the Popup login screen - everything works fine. But if they leave the login screen in their browser - it remembers their last page.

Any further ideas?

---

<div class="post-metadata">

**Author:** ![Dan\_Suhr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dan_suhr/32/94074_2.png) [@Dan\_Suhr](https://forum.wixstudio.com/u/Dan_Suhr)\
**Post date:** [April 9, 2026, 1:10am UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/4 "2026-04-09T01:10:41Z")

</div>

What you’re seeing is expected Wix behavior. The log lines shown are just informational, not actual run errors. The real issue is that Wix’s built-in member login flow remembers the page the member logged in from, and Wix currently does not support forcing all logins to go to one specific page.

Putting `authentication.onLogin()` in site code can help in some cases, but it won’t reliably override Wix’s native return-to-last-page behavior for protected member pages.

The more reliable workaround is to use a custom login button with `await authentication.promptLogin()` and then redirect with `wixLocation.to("/volunteer-home-page")` after login succeeds. If the visitor closes the popup, nothing happens.

If they log in through Wix’s default protected-page flow, Wix may still return them to the page they started from.

---

<div class="post-metadata">

**Author:** ![Skyesj](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Skyesj](https://forum.wixstudio.com/u/Skyesj)\
**Post date:** [April 9, 2026, 2:24am UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/5 "2026-04-09T02:24:42Z")

</div>

thank you . I won’t be able to address this for a day or two. I really appreciate your help! And response.

---

<div class="post-metadata">

**Author:** ![Skyesj](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Skyesj](https://forum.wixstudio.com/u/Skyesj)\
**Post date:** [April 10, 2026, 10:37pm UTC](https://forum.wixstudio.com/t/redirect-to-a-specific-page-after-member-log-in/77545/6 "2026-04-10T22:37:54Z")

</div>

I think I will just leave it with the partial workaround. It is better than it was. The other solution you propose sounds better, but I don’t have the experience to do that. Thanks again! So much!
