Wordpress .htaccess help

wordpress

#1

I am running a Wordpress site with the following code in the .htaccess file

I have a folder named “share” that is in the root of the Wordpress install.

I use the share folder to store photo galleries for clients.

There are folder within the share folder for each year. 2009, 2010, 2011, and 2012.

Within the years folders are specific dates folders like 06-20-2009.

I want to password protect the folder 06-20-2009 using a .htaccess and .htpasswd file.

Whenever I add the .htaccess and .htpasswd file to the dated folder, then try to access the folder (www.example.com/share/2009/06-20-2009), it just redirects me to the main domain name (www.example.com).

Is there something I can add to the .htaccess file in the root folder so it doesn’t apply itself to the share folder or anything under it?


#2

[code]RewriteCond %{REQUEST_URI} ^/share/? [NC]
RewriteRule . - [L]

BEGIN WordPress


[/code]


#3

Hello,
I have similar problem. I need to password protect a folder (e.g. “www.website.com/share/userid”) and tried to do that using .htaccess and .htpasswd files, which contains the following commands:

.htaccess in protected folder “userid”:

AddDefaultCharset UTF-8
AddHandler php5-cgi .php .html .htm .phtml

AuthName "Protected area, need authorization"
AuthType Basic
AuthUserFile /home/don_antonio/website.com/share/userid/.htpasswd
Require valid-user

Options +Indexes

.htpasswd in protected folder “userid”:

.htaccess in the root “website.com”:

[code]AddDefaultCharset UTF-8
AddHandler php5-cgi .php .html .htm .phtml
DirectoryIndex index.htm

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/share/? [NC]
RewriteRule . - [L]

BEGIN WordPress

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

END WordPress

Options -Indexes
[/code]

The problem is that when I try to open in browser the folder “userid” or a file in it I get a redirect to the 404.php instead of asking me to enter the password.

If I do the same in my locally hosted website this method works well.

Does anybody know a cause of the problem?
Please help!
Thanks.