Beginner
How to setup password protected pages on Hostinger
Quick Answer
Password protect pages on Hostinger by accessing the File Manager in your control panel, navigating to the desired directory, and using the Password Protect feature to set up authentication. You can also manually create .htaccess and .htpasswd files for more advanced control.
Prerequisites
- Active Hostinger hosting account
- Access to Hostinger control panel
- Basic understanding of file directories
- Website files uploaded to your hosting account
1
Access Hostinger Control Panel
Log into your Hostinger account and navigate to the Hosting section. Click on Manage next to your domain name to access the control panel dashboard.
Tip
Make sure you're accessing the correct hosting account if you have multiple domains
2
Open File Manager
In the control panel, locate and click on File Manager under the Files section. This will open the file browser where you can manage your website files and directories.
Tip
File Manager may take a few seconds to load all your directories
3
Navigate to Target Directory
Browse to the public_html folder and navigate to the specific directory or page you want to password protect. You can protect entire folders or specific subdirectories within your website structure.
Tip
Create a new folder if you want to group password-protected content together
4
Enable Password Protection
Right-click on the folder you want to protect and select Password Protect from the context menu. If this option isn't available, look for Protect Directory in the File Manager toolbar after selecting the folder.
5
Configure Protection Settings
In the password protection dialog, check the box for Password protect this directory. Enter a Protection Name (this appears in the login prompt) and optionally add a description for the protected area.
Tip
Choose a descriptive protection name that users will understand
6
Create User Credentials
Click Add User to create login credentials. Enter a Username and Password for accessing the protected directory. You can add multiple users with different credentials if needed.
Tip
Use strong passwords and avoid common usernames for better security
7
Save and Test Protection
Click Save to apply the password protection settings. Navigate to the protected directory URL in your browser to test the authentication prompt and verify that the protection is working correctly.
Tip
Test with different browsers to ensure compatibility
8
Manage Protected Areas
Return to File Manager anytime to modify protection settings. Right-click on protected directories to edit users, change passwords, or remove protection entirely through the same context menu.
Tip
Regularly update passwords and remove unused user accounts for security
Troubleshooting
Password protection option not appearing in File Manager
Ensure you're right-clicking on a folder, not a file. If the option is still missing, try refreshing the File Manager or contact Hostinger support as this feature may not be available on all hosting plans.
Authentication prompt not showing when accessing protected directory
Check that the
.htaccess and .htpasswd files were created in the directory. Clear your browser cache and try accessing the URL in an incognito window to rule out caching issues.Correct password not working for protected page
Verify the username and password are entered correctly with proper case sensitivity. Check if the
.htpasswd file exists in the protected directory and contains the encrypted password hash.Internal server error after enabling password protection
Check the
.htaccess file for syntax errors. Ensure the path to .htpasswd file in the .htaccess is correct and uses absolute server paths rather than relative paths.Ready to get started with Hostinger?
Put this tutorial into practice. Visit Hostinger and follow the steps above.
Visit Hostinger →