• I have set up a password protected page – https://www.amisha.co.uk/gifts

    when I put in the correct password it takes me to a 404 error page.

    I have read the forums, saved changes on the permalinks settings. But can’t figure out how to make this work.

    Please advise.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Have you tried disabling your plugins to check if there is a one that is causing this problem.
    Also you should check on your host if they are blocking ?action=postpass. And ask them to whitelist it.

    Hope this helps.

    First, remove the password and see if the page loads fine. Second, try disabling plugins one by one and see if it works

    Thread Starter dancingmelody

    (@dancingmelody)

    I have removed it and the page loads fine. When I add it, the password login loads fine, but then when entering the password, it goes to the 404 page.

    I will check in with my hosting company.

    @dancingmelody,
    Generally password protected posting url generate like.
    https://xyz.com/wp-login.php?action=postpass

    But your form post url are different please check there.
    Also review this answer:

    Thanks,

    Thread Starter dancingmelody

    (@dancingmelody)

    the hosting company couldn’t do anything : (

    Add this code on function.php then says this one working or not?

    function my_password_form() {
        global $post;
        $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
        $o = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
        ' . __( "To view this protected post, enter the password below:" ) . '
        <label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
        </form>
        ';
        return $o;
    }
    add_filter( 'the_password_form', 'my_password_form' );

    I believe you have the same problem as I had with my wordpress website.
    I had a WordPress website where I want to password protect a folder using .htaccess if yes try the following solution:

    open .htaccess from your root (public_html) folder and add the following code at the top of the file

    ErrorDocument 401 default

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Password Protected page going to 404 Error’ is closed to new replies.