Custom index page

We are looking to add a custom index page, essentially a page with some basic info, with 2 button/links, One to register (which is working fine) and then the other to the default login page. The problem is that the login one is not working, it does not load, it acts as if it just refreshes the page. Any assistance with this please (without creating new themes or mods)?
The buttons/links are simple html <a href=""&gt; and, it is the index.php that refuses to load from this "intro.php" page we created.

  • Hard to say without seeing some code for how you added the buttons.  If you're just sending them to other pages for registration or login the default urls for that are {url}/register and {url}/login respectively

  • Yes, they are simple html buttons...

  • Sending them to index.php is incorrect, see my comment above regarding the login url

  • Ok the login page loads, but the issue there is after logging in, it returns right back to our custom "index.html" instead of as a temporary work around we do have a 3rd button that says "if it returns you here after logging in, please click this button" which links to


  • ah, well the problem is that you aren't really using Elgg then.  You're using a static html page that can't tell whether you're logged in or not.  Take a look at the Front Page plugin to see how to actually build a custom home page in elgg.

  • Yeah that is part of the issue we're seeing as well. Custom index loads, allows them to get to login page. the issue depends on several factors from there.
    Person logs in, the site works (loads /activity just fine).
    If they browse to other websites or fail to log out, the next time they load the page it goes right back to the custom page and are unable to get back into the /activity page.

    If they log out before browsing elsewhere or closing browser, then everything works properly, goes to /activity by default.

  • @MikeK that's because the custom index plugin doesn't have the feature to redirect them back to activity. You can use something like:

    if (elgg_is_logged_in()) { forward('activity'); }

  • @Cim That is not working, we get this error:

    Fatal error: Call to undefined function elgg_is_logged_in() in /var/www/html/elgg/intro.php on line 3

  • Oh and as I original stated above, this is a simple custom html page, not a plugin or theme


  • The correct solution for this is to *not* use an html page, create it in a plugin using the front page plugin as a template for how to handle the sessions.  The html output can be exactly the same but you'll have access to all elgg functions.