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 / 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,338 Super User 2025 Season 2 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

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
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard