Jump to content

Recommended Posts

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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...