kristian Posted June 17, 2006 Posted June 17, 2006 Hi, I'm having trouble password protecting a page using Cpanel. I have a wordpress blog that has it's own htacess rewrite rules as follow: ><IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> When I enable password protect from Cpanel, I don't see any changes in the htacess file. Furthermore, I now get re-directed to a 404 page. If I turn off password protection, I can access the page just fine. Just an example of the page I'm trying to protect: http://domain.com/photos my blog's address is http://domain.com/index.php Quote
TCH-Bruce Posted June 17, 2006 Posted June 17, 2006 You cannot password protect one page through cPanel. You can password protect a folder but not a page. Well I guess you could password protect one page if you put it in it's own password protected folder. Quote
kristian Posted June 17, 2006 Author Posted June 17, 2006 Sorry, that's what I meant. I can't password protect the folder. Quote
TCH-Bruce Posted June 17, 2006 Posted June 17, 2006 When you look at the list of folders, does the folder you have selected to be password protected have a lock next to it? Did you remember to check the box and click the Save button? The .htaccess file that would have commands in it for an authenticated user will be in the password protected directory and not your wordpress .htaccess file. I just tested it and it does work. Quote
kristian Posted June 17, 2006 Author Posted June 17, 2006 Thanks for the prompt response. When you look at the list of folders, does the folder you have selected to be password protected have a lock next to it? Did you remember to check the box and click the Save button? Yes, the folder has a lock next to it and I did click the Save button. The .htaccess file that would have commands in it for an authenticated user will be in the password protected directory and not your wordpress .htaccess file. I just tested it and it does work. The files are there, however I'll just get directed to a 404 page when I enable the option. Perhaps it's the .htaccess file for the Wordpress blog that's messing this up? Quote
kristian Posted June 17, 2006 Author Posted June 17, 2006 Ok, defintely something to do with the .htaccess file in the root directory as I've listed above. I changed it to .old_htacess and tried accessing the password protected folder and it worked. Quote
kristian Posted June 19, 2006 Author Posted June 19, 2006 OK. I managed to find a solution. >ErrorDocument 401 /error.html ErrorDocument 403 /error.html ErrorDocument 404 /error.html # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress ALso created an "error.html" file which I've uploaded. Quote
waveflux Posted June 20, 2006 Posted June 20, 2006 I'm using Movable Type 3.2 and have run into the same situation. kristian was kind enough to share her solution with me, but it didn't take. I'll post my own thread and ask for help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.