Redirecting User to a Specific page in Power Portal
I was working in some requirement and for some business requirement I wanted to Redirect a page which is not available in my portal to another page. So to do this We have configured Redirects option available in power portal.
NOTE : Remember that the Re-direct will only work if the page the user trying to access in not available in your portal and you want to redirect to another page.
Let us say you have shared a specific URL to other external websites or third parties to hit a specific page of your portal and for some reason the page is not available. So with out changing all external website UTL as yo do not have authority to change, you can configure a Redirect which will redirect to a new page either temporarily or Permanent as per your requirement.
Also for some business scenario lets say you are trying to enhance the an existing page and temporarily you want to redirect to another page. Then you can rename the old page and configure a Redirect to a temporary page.
Go to Portal management App and click Redirects and Create new Redirect. In the Redirect Record you have to give below details.
- name : name of the Redirect record of your choice
- Website : the website for which the Redirect will apply
- Inbound URL : the partial page name that user will browse
- Status Code : Choose either Temporary Redirect / Permanent Redirect
- Web page : The web page to which you want to redirect
here I am redirecting from “contact” page to “Contact Us” page. Make sure the contact page is not available in your portal and that’s why you are redirecting to new page.
This above option will only work whenever the inbound page is not available. Now what if you want to redirect from one page to another and both page is available. Let say you have a home page and you want to redirect to SignIn page by default whenever someone loads home page of portal.
For this scenario the above Redirect option will not work. So you have to write some script.
For example if you want to redirect visitors from Home default page to SignIn page if the user is not logged in and Redirect to Contcat Us when the user logged in then you have to write the below script inside Home page Web Template.
{% if user %}
<script>
window.location.href='./contact-us/';
</script>
{% else %}
<script>
window.location.href='./SignIn/';
</script>
{% endif %}
Hope this will help
Don’t miss the chance to participate in the upcoming Internship Program which will be done using Microsoft Dot Net Web Development Full Stack Technology. The new batch will be starting from May 20, 2024. We will have most experienced trainers for you to successfully complete the internship with live project experience.
Why to choose Our Internship Program?
Industry-Relevant Projects
Tailored Assignments: We offer projects that align with your academic background and career aspirations.
Real-World Challenges: Tackle industry-specific problems and contribute to meaningful projects that make a difference.
Professional Mentorship
Guidance from Experts: Benefit from one-on-one mentorship from seasoned professionals in your field.
Career Development Workshops: Participate in workshops that focus on resume building, interview skills, and career planning.
Networking Opportunities
Connect with Industry Leaders: Build relationships with professionals and expand your professional network.
Peer Interaction: Collaborate with fellow interns and exchange ideas, fostering a supportive and collaborative environment.
Skill Enhancement
Hands-On Experience: Gain practical skills and learn new technologies through project-based learning.
Soft Skills Development: Enhance communication, teamwork, and problem-solving skills essential for career success.
Free Demo Class Available