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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / how to create redirect...
Power Pages
Unanswered

how to create redirect url in Powerpage

(0) ShareShare
ReportReport
Posted on by 11

Hello all, 

 

I'm very new to power portal, I'm trying to create a redirect url from "homepage" to "sign in page", and with multiple tried it still didn't work, could you help to check/guide me if below are the correct way? many thanks!

 

Screenshot 2023-06-22 at 9.38.03 PM.png

 

Cheers,

PS

Categories:
I have the same question (0)
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    Hi @yps104 ,

     

    Here are the steps to do this:

     

    1- Open Portal Management App

    2- Navigate to Web Templates -> Header

    3- Add this script at start.

     

    {% if user %}
    window.location.href='./profile';
    {% else %}
    <script>
     if(window.location.href != "" && (window.location.href=="https://myportal.powerappsportals.com/" || window.location.href=="https://myportal.powerappsportals.com")){
     window.location.href = "https://myportal.powerappsportals.com/SignIn";
     }
    </script>
    {% endif %}

     4- Replace myportal with your actual portal URL.

     

    Feel free to share, if you face any issues.

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Fubar Profile Picture
    8,487 Super User 2026 Season 1 on at

    The Redirect you are attempting is intended for the scenario where you have a page that uses may have been accessing and you then decide to remove it and so when someone uses that url it redirects to the new replacement page. (doesn't work so well if you try to do it on the home page).

     

    If you want to force all users and visitors to the login page, create a Web Page Access Control Rule (for the home  web page.)  and associate it to the Authenticated Users web role.

    https://learn.microsoft.com/en-us/power-pages/security/page-security#manage-page-permissions-with-the-portal-management-app

     

    (The only other redirect available is to do something in JavaScript)

     

  • yps104 Profile Picture
    11 on at

    Hi Fubar,

     

    Thanks for the solution, will try that in a while. I have another question, I have two user groups, public users to view homepage and certain pages only but to view other restricted pages requires authenticated users or in a way public users need to be authenticated, may i know whats the usual best practice for this workaround? thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 21 Super User 2026 Season 1

#2
Fubar Profile Picture

Fubar 19 Super User 2026 Season 1

#3
CN-06091549-0 Profile Picture

CN-06091549-0 18

Last 30 days Overall leaderboard