Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author stenberg.me

    (@stenbergme)

    Hi,

    Sounds like your target environment (production) is protected by e.g. basic auth. Is that the case?

    Thread Starter wahhadesign

    (@wahhadesign)

    The staging environment is. And is hosted on Network Solutions.

    Plugin Author stenberg.me

    (@stenbergme)

    Alright, are you sending content from your production environment to your content stage?

    Normally it’s the other way around, but whatever works for you is fine.

    What you probably have to do is to include an Authorization header when making a request to the environment protected by Basic Auth.

    Here is an example of doing that, add it to e.g. functions.php:

    function set_content_staging_client_headers( $headers ) {
    
    	if ( defined( 'CONTENT_STAGING_BASIC_AUTH_USER' ) && defined( 'CONTENT_STAGING_BASIC_AUTH_PASSWORD' ) ) {
    		$headers['Authorization'] = 'Basic ' . base64_encode( CONTENT_STAGING_BASIC_AUTH_USER . ':' . CONTENT_STAGING_BASIC_AUTH_PASSWORD );
    	}
    
    	return $headers;
    }
    
    add_filter( 'sme_client_headers', 'set_content_staging_client_headers' );

    Then in your configuration file (wp-config.php) on the host that is NOT Basic Auth protected, add the constants:

    define( 'CONTENT_STAGING_BASIC_AUTH_USER', '_YOUR_BA_USERNAME_HERE' );
    define( 'CONTENT_STAGING_BASIC_AUTH_PASSWORD', '_YOUR_BA_PASSWORD_HERE' );

    Probably something worth including in the plugin, but for now I hope this helps!

    Thread Starter wahhadesign

    (@wahhadesign)

    Thank you, it seems that it is at least connecting now. I’m not seeing any pushes being made. I checked to make sure guid fields were the same in the database.

    Thread Starter wahhadesign

    (@wahhadesign)

    Also, my password protected area is the staging, not the live environment.

    Plugin Author stenberg.me

    (@stenbergme)

    What message(s) do you get during pre-flight?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘transport error – HTTP status code was not 200 (401) – on host’ is closed to new replies.