web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Redirect to Home page ...
Power Pages
Answered

Redirect to Home page after user login to portal

(0) ShareShare
ReportReport
Posted on by 92

Hello Team,

I need to redirect to Home page after user successfully log-in the portal.

Problem = When user log-out from specific page then getting that page URL at sign-in page and due to this at re-login user redirecting to page where he was logged-out previously.

Let me know if there is any solutions for this issue.

Thanks,
Vaibhav 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, you can achieve this by changing the sign-out link on the Header Web Template.

     

    Please follow this article: http://shaikhd365.blogspot.com/2019/07/redirect-to-home-page-when-logout-into.html

     

  • Vaibhav S Jadhav Profile Picture
    92 on at

    Hi @OliverRodrigues I tried by what mentioned in given link, but it changes the menu UI and also not redirected to Home page when I re-login.

    Below is my code:

    <a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }}" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
    {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
    </a>

    After Change :
    <a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl=%2home" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi, I just tried here the following and it worked

    Instead of specifying home, I am specifying the root page with just a slash / :

    <a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl=/" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
     {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
    </a>

     

  • Vaibhav S Jadhav Profile Picture
    92 on at

    @OliverRodrigues  Thanks for verifying . I used this and it also works.

    {% assign homelink = '/Account/Login/LogOff?returnUrl=%2F' %}
    <a role="menuitem" aria-label="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}" href="{% if homeurl%}/{{ homeurl }}{% endif %}{{ homelink }}" title="{{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}">
    {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
    </a>
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    perfect, that's the same URL you just assigned to a variable

     

    can you mark my previous reply as the answer in case other people are looking for similar results

    nevermind, just saw you did this

     

    thanks

  • Community Power Platform Member Profile Picture
    on at

    @VSJadhav  is '/Account/Login/LogOff?returnUrl=%2F' URL specific to your portal or common?

     

  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    that would be a common URL @Anonymous 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 74 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard