restrict access to one page using htaccess
-
I have a page in WordPress theme_directory/page-rsvp.php that i need password protected by .htaccess. I’m developing this locally using MAMP PRO. My permalink settings are set to Day and Name.
I have an .htaccess and .htpasswd file in the theme_directory. I have the following in the .htaccess file but it’s not working. Whenever I go to localhost:8888/site/rsvp the authentication prompt doesn’t show up.
<Files "page-rsvp.php"> AuthName "Username and password required" AuthUserFile ./.htpasswd Require valid-user AuthType Basic </Files>
There is of course the .htaccess file in the root of the wordpress install that looks like this:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /thepowerfulnow/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /thepowerfulnow/index.php [L] </IfModule> # END WordPress
How do I get this to work using only the first .htaccess file (the one in the theme_directory)? I need to have this theme be modular. I’m very new to .htaccess files. If getting this to work using only the first .htaccess file isn’t possible what other simple solutions are there? Thank you all!
- The topic ‘restrict access to one page using htaccess’ is closed to new replies.