htaccess, wp-admin and TML
-
Dear Experts,
I have an issue and hope you could help me with your insights and pointers. I’m building a site where authors could update their profile from the frontend – the functionality delivered by the TML plugin. I have also created a .htaccess file in the wp-admin folder for an extra layer of protection. The .htaccess file has the following content:
AuthType Basic AuthName "Protected Area" AuthUserFile /Users/devuser/htdocs/hueman/.htpasswda3 AuthGroupFile /dev/null Require user site_administrator Order Deny,Allow Allow from site.localhost
The .htaccess prompts with a username/password popup whenever an attempt is made to access wp-admin directly. So far, so good.
The issue, however, is as follows.
Whenever an author attempts to update his/her profile, the popup appears over and over again. The site authors don’t have access to admin credentials and I’m seeking a way to do away with the popup window.
I also tried to encapsulate the above .htaccess directives using the conditional statement:
<If "!(%{HTTP_REFERER} -strmatch 'https://site.localhost/*')"> AuthType Basic AuthName "Protected Area" AuthUserFile /Users/devuser/htdocs/hueman/.htpasswda3 AuthGroupFile /dev/null Require user site_administrator Order Deny,Allow Allow from site.localhost </If>
The above logic was that once the user has logged in, any access to wp-admin will match the strmatch condition, so the prompt should not appear. However, this isn’t happening and the irritating popup keeps appearing.
I looked at wp-admin access from TML plugin and it appears that the plugin requires users.php, profile.php and misc.php, which are all located in the wp-admin directory.
I have tried several permutations with the various htaccess directives, such FilesMatch, DirectoryMatch, Files, etc., but the issue persists.
I have temporarily removed the .htaccess protection for wp-admin, but would like to keep it for security reasons. However, I’m also open to other suggestions.
The site I’m running already has over 20 essential plugins for functionality, so I’m trying to keep away from installing additional plugins. Besides, htaccess seems to offer some network level security, which is interesting for the objective.
I’d really appreciate any pointers that help me resolve this issue.
Thanks in advance!
Best Regards,
Mithun
- The topic ‘htaccess, wp-admin and TML’ is closed to new replies.