403 Forbidden Error
The 403 Forbidden error can be due to several different factors. Follow the steps below to find the cause of the error.
WC Autoship Configuration
- Log in to the WP Admin Dashboard.
- Navigate to WooCommerce > Settings > WC Autoship.
- Click the button to "Reset WC Autoship Configuration".
- Follow the on-screen alerts to re-configure WC Autoship.
Additionally, see Auth Failed Due to invalid client.
.htaccess Access Restrictions
If you have blocked public access to your site with a username and password, these credentials must be added to your WC Autoship settings.
- Log in to the WP Admin Dashboard.
- Navigate to WooCommerce > Settings > WC Autoship.
- Scroll to the Site Access section.
- Enter the Username and Password into the fields provided and save your changes.
File Write Permissions
WC Autoship requires write permissions on the server. You may need to contact your server administrator to confirm these settings. The following directories require read and write permissions for the PHP functions mkdir() and fwrite():
- /wp-content/uploads
- the system temp directory
If these settings are not possible, you may need to override the default write directory. Add the constant below to your wp-config.php file:
/** * WC Autoship writable dir */ define('WC_AUTOSHIP_PIPEY_DIR', sys_get_temp_dir());
Caching
Caching settings may cause unexpected results when configuring WC Autoship. Ensure that all caching settings and caching plugins have been disabled until WC Autoship has been successfully configured. In addition, caching for the WP Admin pages (/wp-admin) should always be disabled.
Redirect Rules
Redirect rules are problematic for WC Autoship. Always ensure that the site is accessible at the exact URL found in the General Settings. Redirecting away from this URL (for example http to https) will cause errors with Autoship. Remove all redirect settings, including .htaccess and plugins, before configuring WC Autoship.
Server Settings
There are many server-level restrictions that may be in effect. You will need to contact your server administrator to find whether server access restrictions are in effect. Some possible restrictions that may be prohibitive are listed below:
- IP address restrictions
- Regional access restrictions
- HTTP User-Agent Header restrictions
open_basedir
Contact your server administrator to find whether your server has open_basedir restrictions in effect. This is a highly restrictive configuration that will not work with WC Autoship. This restriction will need to be removed to allow for WC Autoship to run successfully.