RapidWeaver Elements 1.0.12 (23755)
Hi Ben, In my 3 Classic RapidWeaver sites I use Page Safe to have a restricted members only page protected with a password Is elements going to include something similar? I really need this feature.
RapidWeaver Elements 1.0.12 (23755)
Hi Ben, In my 3 Classic RapidWeaver sites I use Page Safe to have a restricted members only page protected with a password Is elements going to include something similar? I really need this feature.
I have got that via my host with no need for components etc..
Hi @Marcellus
Right now we don’t have a Password component built-in to Elements, however, you could achieve a basic password protected page using an htaccess file (I’m guessing this is how @Godber is doing it via his hosting company).
@elementsbot could you explain how password protection works using an htaccess file?
Absolutely! Here’s how you can password-protect a page using an .htaccess
file—classic web trick, works perfectly with any site exported from Elements. No special components needed, just a little old-school magic.
Step 1: Export your Elements site
Publish/export your site as usual from Elements.
Step 2: Navigate to the folder you want to protect
Say you have a folder called members
—that’s where your members-only page lives.
Step 3: Create (or edit) the .htaccess
file
Add this to a new file named .htaccess
inside your members
folder:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /full/path/to/.htpasswd
Require valid-user
Important: Replace /full/path/to/.htpasswd
with the absolute path to your .htpasswd
file on the server (not the website URL!). Your host can usually tell you what this is, or they might have a tool for it.
Step 4: Create a .htpasswd
file
This file stores your usernames and encrypted passwords. Easiest way:
.htpasswd
generator (Google it!),htpasswd -c .htpasswd yourusername
.htpasswd
file to your server (ideally outside your web root for security).Step 5: Test it out!
Visit your protected page. You’ll get a pop-up login box!
.htpasswd
file.References:
If you need an “.htaccess-for-humans” walkthrough, I can make it even more beginner-friendly—just say the word! Or, you can share who your hosting company is and I’ll tailor instructions.
@Marcellus let me know if you get stuck (I’m not password-protected…yet).
If you need a more comprehensive solution, I can recommend Sitelok from Vibralogix.
I started with Page Safe but swiftly moved to Sitelok as it is a much more comprehensive solution.
Vibralogix now have Elements Components to support Sitelok (see Using Sitelok with Elements towards the bottom of the linked page).
Hey @elementsbot. Did you have a solution for Microsofts IIS?
Ah, clever question, @Ulrich! IIS (Microsoft’s web server) does things a bit differently from Apache, so the old .htaccess trick won’t work there. But don’t panic—I’m not just a one-trick (Linux) pony!
Here’s how you can password-protect pages (or folders) if you’re on Microsoft IIS and using Elements (or, honestly, any site):
The best “no-code” way is through the server’s GUI:
Now, when someone visits the protected URL, they’ll see a username/password box—just like .htaccess on Apache.
Don’t fancy clicking around? Here’s a snippet for your web.config
(place it in the protected folder):
<configuration>
<system.webServer>
<security>
<authentication>
<basicAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="YourWindowsUsername" />
</authorization>
</security>
</system.webServer>
</configuration>
Replace YourWindowsUsername
with the Windows user who should have access.
web.config
) to the protected folder.For more geek-out details, check the official IIS docs on authentication here.
Let me know what kind of Windows hosting you’re using (VPS, dedicated, shared, Plesk, etc.)—I can get even more specific if you need!
—
This Elements Bot does Windows… but only because you asked nicely!