I have a site with a virtual directory structure, such as mysite.com/folder/titleone that actually rewrites .htaccess to mysite.com/f/index.php?p=title. I want to password protect a folder folderwith .htaccess and know how to do this with actual folders. But I do not want the password to protect the main site mysite.com, and right now, if I put the .htaccess file in a directory mysite.com, I protect mysite.comand mysite.com/folder. I also tried to protect mysite.com/f.
How to protect only mysite.com/folderwith .htaccess?
EDIT: Added .htaccess content mysite.com.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^folder/(.*)$ /f/index.php?p=$1 [PT,L,QSA]
RewriteRule ^folder/*$ /f/index.php [L,QSA]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
.htaccess , mysite.com/f. mysite.com, , . , 404, .
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/myusername/.htpasswd
require valid-user