Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Redirect on Sign in Page in Dynamics 365 Portal

(0) ShareShare
ReportReport
Posted on by 373

Hi,

I want to open Sign In Page directly, when any one hit the Portal URL. 

Can we redirect Home page on Sign-In page?

Can we applied any other approach for that?

Please suggest me good solution?

Thanks!

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at
    RE: Redirect on Sign in Page in Dynamics 365 Portal

    Hi Cristina,

    When you are redirecting user from homepage to sign in page, what happens when they sign in. They will again be redirected to the sign in page. I think for first time user it will be the profile page after they sign in. Probably, you need to place a condition if the user is not signed in then redirect.

    Best Regards

    PG

  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at
    RE: Redirect on Sign in Page in Dynamics 365 Portal

    Hi Partner,

    You could add custom JS code in Home webpage to do this.

    Please refer to the following steps.

    1.Go to Dynamics 365 Portal Management and find your Home web page for your website.

    pastedimage1600653412575v1.png

    2.Open the record and in "Localized Content" session, open the "Home" record again.

    pastedimage1600653476555v2.png

    3.In "Advanced" tab, use the following JS code.

    pastedimage1600653520908v3.png

    $(function () {
        var url = document.location.toString();
        var arrUrl = url.split("//");
        var start = arrUrl[1].indexOf("/");
        var relUrl = arrUrl[1].substring(start 1,start 7);
        if(relUrl==null||relUrl==""||relUrl==undefined||relUrl!="SignIn"){
            window.location.href="SignIn";
        }
    })

    Save and wait the settings sync to Portal.

    Then when you go to the portal URL directly, the page will be redirected to SignIn page as you wish.

    Regards,

    Leo

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,125 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,871 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans