Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple password protection of Framer.js projects pushed to Heroku
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^https://(.*\.)? [NC]
RewriteCond %{HTTP_REFERER} !^https://(.*\.)?*$ [NC]
RewriteRule \.(html|coffee|js)$ - [F]
1. add index.php and .htaccess to Framer project root
2. set password in the index.php file (line 4)
3. push the project to Heroku, it will auto-configure everything and give you the project URL
- the index.php just asks for password and loads index.html if correct
- the .htaccess just makes sure nobody can access directly index.html or (or any other html/coffee/js file)
$pass = $_POST['pass'];
if($pass == "password")
<form method="POST" action="index.php">
Password <input type="password" name="pass"></input><br/>
<input type="submit" name="submit" value="Go"></input>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.