WSS3: How to redirect to alternative homepage other than default.aspx in content database?

Answered WSS3: How to redirect to alternative homepage other than default.aspx in content database?

  • Monday, March 10, 2008 1:43 PM
     
     
    Hi,

    I have WSS3 installed. Form Authentication implemented. What I am trying to do now is that I would like to wss3 to redirect users to another page other than default.aspx which is stored in content database.

    Currently, when I type the http://srv, it shows http://srv/_layouts/mylogin/login.aspx?ReturnUrl=%2f, and after login, I will be in the http://srv/default.aspx page.

    If I take ?ReturnUrl=%2f away from the url, use the url http://srv/_layouts/mylogin/login.aspx, I will be redirected to page http://srv/_layouts/my/default.aspx.


    Does anyone know some solution to this problem?

    Thanks!


    Chen

All Replies

  • Friday, March 14, 2008 3:42 AM
     
     Answered

    You can add a content editor webpart onto your default.aspx and add

    <script language="javascript">

          window.location.href = "[your desired URL]";

          </script>

    But then, your default.aspx will not be accessible at all, because everytime you hit it, you will be redirected. If it’s not the desired functionality then I would recommend adding a cookie to the user’s browser before redirecting. And every time the default.aspx is hit again, first check for a cookie (it will be an indicator if users have already been on the page). If cookie exists, do not redirect, otherwise set the cookie and redirect.