• Hello, i installed Page Restriction v1.4 but when i try to access the page that i checked as restricted i get this error:

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/vhosts/versionitradotte.it/httpdocs/wp-content/themes/ocadia/header.php:5) in /var/www/vhosts/versionitradotte.it/httpdocs/wp-includes/pluggable-functions.php on line 220

    I opened pluggable-functions.php and i saw the line 220:

    header(‘Location: ‘ . get_settings(‘siteurl’) . ‘/wp-login.php?redirect_to=’ . urlencode($_SERVER[‘REQUEST_URI’]));
    exit();

    What’s wrong?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Edit the plugin file and make sure there are no extra spaces or lines at the beginning or end of the files (outside of the php tags).

    Thread Starter smartmouse

    (@smartmouse)

    I checked it out: all is ok.

    What could be the problem?

    Thread Starter smartmouse

    (@smartmouse)

    It says:

    Interpreting the Error Message:

    If the error message states: Warning: Cannot modify header information – headers already sent by (output started at /path/blog/wp-config.php:34) in /path/blog/wp-login.php on line 42, then the problem is at line #34 of wp-config.php, not line #42 of wp-login.php. In this scenario, line #42 of wp-login.php is the victim. It is being affected by the excess whitespace at line #34 of wp-config.php.

    …and then says:

    # Check that the very first characters are <?php
    # Check that the very last characters are ?>

    Mmm… i checked out header.php file on line 5… but it seems ok. Anyway have a look to the entire file:
    https://pastebin.com/631866

    It does not start with “<?php” and it does not end with “?>”. Is it that the problem?

    Thread Starter smartmouse

    (@smartmouse)

    Please help me!

    Thread Starter smartmouse

    (@smartmouse)

    Then…

    The error message is:

    Warning: Cannot modify header information – headers already sent by (output started at /var/www/vhosts/versionitradotte.it/httpdocs/wp-content/themes/ocadia/header.php:5) in /var/www/vhosts/versionitradotte.it/httpdocs/wp-includes/pluggable-functions.php on line 220



    The line 5 of header.php is:

    <meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” />



    The line 220 of pluggable-functions.php is:

    header(‘Location: ‘ . get_settings(‘siteurl’) . ‘/wp-login.php?redirect_to=’ . urlencode($_SERVER[‘REQUEST_URI’]));



    It is not related to no extra spaces or lines at the beginning or end of the files. So what could be the reason for that error??

    Thread Starter smartmouse

    (@smartmouse)

    Anyone is able to help me?

    I was able to get the Page Restriction plugin working after following the tweaks available on the author’s website.

    However, I have an additional question now that it’s working. I’d like it to check, not only whether a user is registered or not, but if they’re of a sufficient level/role to view the page. jweaks had a small hack for this but I could not get it to work.

    Any help or suggestions?

    I’m having the same issues but the comments section of the author’s website doesn’t seem to be working. I guess that doesn’t bode too well for the plug-in then eh?…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Page restriction plugin: it does not work’ is closed to new replies.