In certain cases it's useful to have a login-protected page, but to be able to circumvent that with a special link that you can share to special users;
- A unique special offer
- A customer-only pricing page
- Internal products specs, a CV or a special download
Webflow doesn't support this natively however the standard password-protection feature can be easily augmented using a bit of JS.
In this way, if I have set a page to anyone with the password and assigned a password of secret, I can then share a direct link to that page as;
https://www.mysite.com/myprotectedpage?pass=secret
Users who click that link will briefly see the login page, and will be automatically logged in before being directed to the protected page.
Implementation
Add this to the Password utility page, in the /body custom code section.
Do not add it to the page that you are password-protecting, it must go on the utility page itself, which is next to the 404 page in Webflow's page navigator.
Publish your site, and test it out by using a URL to your protected page.
Note, the password protection feature only works on hosted sites, which means you must have a hosting plan in place for this to work.
Notes
- If you have several password protected pages and folders throughout your site, you should only need to implement this once, and it should work for all of them, even if they have different passwords. Make certain to use the right password in the URL.
- People who do not have the ?pass=your-password part of the URL will be directed to the login page and will need to manually login.