Why do I see a 404 page when testing an affiliate link?
Troubleshooting pretty URLs
If you're seeing a 404 page when testing an affiliate link (using a pretty URL structure such as /ref/123, or /ref/john) the following may help:
- Go to Settings → Permalinks
- Click Save Changes (you don't need to change anything)
- Test the affiliate referral URL again
Performing the above steps will flush WordPress' rewrite rules and should fix the issue.
Tip: Simply visiting the permalinks page without saving anything will still flush the rewrite rules, but clicking a button sure feels good!
If the 404 error persists after performing the above steps:
- If after flushing your permalinks, you’re still seeing a 404 error, try re-saving AffiliateWP's General settings. Go to the Affiliates → Settings → General tab, scroll to the bottom of the page and click Save Changes.
- If the 404 error persists, try clearing your browser cache. If you are using a caching plugin on your WordPress site, clear the cache on your site as well.
- If pretty URLs are still showing a 404 page, it may be due to a plugin conflict. To diagnose this, try temporarily deactivating all other plugins except for AffiliateWP. Flush your permalinks as per the steps above, and test pretty URLs again.
- If pretty URLs are still not working correctly, you could try changing your permalink structure type* (*see below) in WordPress’ permalink settings (i.e. "Post Name"). You can check your permalink structure under Settings → Permalinks.
* Important note on changing your permalink structure type:
- Any existing links to your website on 3rd-party sites or saved by visitors/customers with a different URL structure ("Default", etc.) may break if you change your existing permalink structure type without setting up URL redirects - especially if your website is well-established.
- There are various plugins available on the WordPress repository which allow you to set up redirects, so you can change your permalink structure without impacting external links or traffic to your website.
- If you're in the process of building your website, and pretty URLs are your preferred URL structure, using the "Post Name" or other pretty URL structure type from the outset will allow you to avoid these issues. (AffiliateWP accepts no responsibility for broken links if the permalink structure type is changed by a site admin.)