WordPress.org

Ready to get started?Download WordPress

Forums

Re-direct to holding page (1 post)

  1. obidos
    Member
    Posted 1 year ago #

    Hi all,

    I am working on a wordpress site and have created a simple php login page stored in it's own folder /new/

    This uses the following code to direct people who have not loged in to the main wordpress root and its index.php file.

    The index.php file for wordpress looks like this:-

    <?php
    session_start();
    if ( !isset( $_SESSION['username'] ) )
    {
    	header( "Location: holding.html" );
    }
    
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./wp-blog-header.php');

    It used to work on old versions of WordPress but this one I just get directed to the holding page even if the login details are correct.

    I get the following error:-
    Warning: Cannot modify header information - headers already sent by (output started at /home/sitename/public_html/new/index.php:11) in /home/sitename/public_html/new/index.php on line 12

Topic Closed

This topic has been closed to new replies.

About this Topic