Support » Plugin: 301 Redirects - Easy Redirect Manager » Bug in Headers? 301 Temporary and 301 Permanent?

  • Resolved John

    (@kcrnc)


    I was reviewing the headers that get sent with a request and noticed what appears to be an invalid header/logic in the ‘set_header_status’ function.

    The current function is:

    private static function set_header_status( $status = '301' )
        {
            if( $status == '302' )
            {
                header ('HTTP/1.1 301 Moved Permanently');
            }
            else
            {
                header ('HTTP/1.1 301 Moved Temporarily');
            }
        }

    This looks like it will send the incorrect header in all cases(301 vs 302,) shouldn’t it be like below or is there a reason to do this?

    private static function set_header_status( $status = '301' )
        {
            if( $status == '302' )
            {
                header ('HTTP/1.1 302 Moved Temporarily');
            }
            else
            {
                header ('HTTP/1.1 301 Moved Permanently');
            }
        }

    https://wordpress.org/plugins/eps-301-redirects/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Bug in Headers? 301 Temporary and 301 Permanent?’ is closed to new replies.