Apache authentication inside a WordPress installWebDAV on CentOS - getting 403 error when attempt to uploadHow to Protect Apache server from this attack.htaccess directory nightmareApache mod_setenvif Server_Addr.htaccess password protection not working in localhostApache authentication requirement based on locationDoes Amazon Elastic Beanstalk cope with HTTP Authentication?Mod_rewite - do these rewrite rules work?Difference b/w .htaccess and example.com.confPHP scripts fail after adding .htaccess to password protect a dir

Multi tool use
Multi tool use

Where did the “vikings wear helmets with horn” stereotype come from and why?

What are the problems in teaching guitar via Skype?

What is the probability of having a pair of doubles when throwing dice?

Infinitely many hats

Turn on QGIS Dark Mode

What is the difference between nullifying your vote and not going to vote at all?

Can a helicopter mask itself from Radar?

What caused the tendency for conservatives to not support climate change regulations?

If a massive object like Jupiter flew past the Earth how close would it need to come to pull people off of the surface?

Is having a hidden directory under /etc safe?

What is the indigenous Russian word for a wild boar?

How to prevent bad sectors?

Can an old DSLR be upgraded to match modern smartphone image quality

Adding strings in lists together

Mother abusing my finances

How old was this woman (from Tomb of Annihilation) at her death?

Uncommanded roll at high speed

If a problem only occurs randomly once in every N times on average, how many tests do I have to perform to be certain that it's now fixed?

Modern approach to radio buttons

What are the slash markings on Gatwick's 08R/26L?

Socratic Paradox

Differences between “pas vrai ?”, “c’est ça ?”, “hein ?”, and “n’est-ce pas ?”

chmod would set file permission to 000 no matter what permission i try to set

The deliberate use of misleading terminology



Apache authentication inside a WordPress install


WebDAV on CentOS - getting 403 error when attempt to uploadHow to Protect Apache server from this attack.htaccess directory nightmareApache mod_setenvif Server_Addr.htaccess password protection not working in localhostApache authentication requirement based on locationDoes Amazon Elastic Beanstalk cope with HTTP Authentication?Mod_rewite - do these rewrite rules work?Difference b/w .htaccess and example.com.confPHP scripts fail after adding .htaccess to password protect a dir






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am currently running into an issue with trying to password protect a directory that is sitting inside a directory that's running WordPress. This is for a directory called "admin" that handles a few things outside of WP.



In my WordPress .htaccess file, I have set a rule to ignore this directory.



RewriteEngine On
RewriteBase /
RewriteRule ^(admin|index.php)$ - [L]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


When I go to my admin directory, it works just fine and I'm able to see what I should be seeing (basic PHP stuff).



However, when I try and password protect that directory by putting an .htaccess and .htpassword file in there, I get a WordPress 404 error. This is what it looks like:



AuthUserFile /home/myuser/public_html/admin/.htpasswd
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>


It (obviously) has something to do with the "require valid-user" line. This particular .htaccess/.htpasswd file worked just fine on a similar server set up.



Any thoughts?










share|improve this question






















  • A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

    – Shane Madden
    Apr 4 '11 at 18:20











  • It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

    – Charles Chadwick
    Apr 4 '11 at 20:23

















0















I am currently running into an issue with trying to password protect a directory that is sitting inside a directory that's running WordPress. This is for a directory called "admin" that handles a few things outside of WP.



In my WordPress .htaccess file, I have set a rule to ignore this directory.



RewriteEngine On
RewriteBase /
RewriteRule ^(admin|index.php)$ - [L]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


When I go to my admin directory, it works just fine and I'm able to see what I should be seeing (basic PHP stuff).



However, when I try and password protect that directory by putting an .htaccess and .htpassword file in there, I get a WordPress 404 error. This is what it looks like:



AuthUserFile /home/myuser/public_html/admin/.htpasswd
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>


It (obviously) has something to do with the "require valid-user" line. This particular .htaccess/.htpasswd file worked just fine on a similar server set up.



Any thoughts?










share|improve this question






















  • A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

    – Shane Madden
    Apr 4 '11 at 18:20











  • It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

    – Charles Chadwick
    Apr 4 '11 at 20:23













0












0








0








I am currently running into an issue with trying to password protect a directory that is sitting inside a directory that's running WordPress. This is for a directory called "admin" that handles a few things outside of WP.



In my WordPress .htaccess file, I have set a rule to ignore this directory.



RewriteEngine On
RewriteBase /
RewriteRule ^(admin|index.php)$ - [L]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


When I go to my admin directory, it works just fine and I'm able to see what I should be seeing (basic PHP stuff).



However, when I try and password protect that directory by putting an .htaccess and .htpassword file in there, I get a WordPress 404 error. This is what it looks like:



AuthUserFile /home/myuser/public_html/admin/.htpasswd
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>


It (obviously) has something to do with the "require valid-user" line. This particular .htaccess/.htpasswd file worked just fine on a similar server set up.



Any thoughts?










share|improve this question














I am currently running into an issue with trying to password protect a directory that is sitting inside a directory that's running WordPress. This is for a directory called "admin" that handles a few things outside of WP.



In my WordPress .htaccess file, I have set a rule to ignore this directory.



RewriteEngine On
RewriteBase /
RewriteRule ^(admin|index.php)$ - [L]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule . /index.php [L]


When I go to my admin directory, it works just fine and I'm able to see what I should be seeing (basic PHP stuff).



However, when I try and password protect that directory by putting an .htaccess and .htpassword file in there, I get a WordPress 404 error. This is what it looks like:



AuthUserFile /home/myuser/public_html/admin/.htpasswd
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>


It (obviously) has something to do with the "require valid-user" line. This particular .htaccess/.htpasswd file worked just fine on a similar server set up.



Any thoughts?







apache-2.2 .htaccess wordpress password-protected .htpasswd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 4 '11 at 18:03









Charles ChadwickCharles Chadwick

2816




2816












  • A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

    – Shane Madden
    Apr 4 '11 at 18:20











  • It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

    – Charles Chadwick
    Apr 4 '11 at 20:23

















  • A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

    – Shane Madden
    Apr 4 '11 at 18:20











  • It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

    – Charles Chadwick
    Apr 4 '11 at 20:23
















A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

– Shane Madden
Apr 4 '11 at 18:20





A 401 error, as opposed to a 404, is what you would expect to see if the require valid-user line were breaking things. Anything helpful in the Apache error log?

– Shane Madden
Apr 4 '11 at 18:20













It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

– Charles Chadwick
Apr 4 '11 at 20:23





It specifically says 404, not 401 (but I that's coming from WordPress). And no, I don't see anything in the error log.

– Charles Chadwick
Apr 4 '11 at 20:23










1 Answer
1






active

oldest

votes


















0














Try closing your browser and then trying to connect. You may have cached credentials that are being used.



If you have multiple secured directories with different passwords, use different values for the Authname.



EDIT: Try moving the Require outside the Limit statement. I always group the Auth definitions with the Require statement in the same block.



Your error seems to indicate the requested resource does not exist or is not readable. Try removing your rewrite modifications for admin. The standard rewrite rules work well with directories and files mixed into the Wordpress installation.



You may want to use a LimitExcept block instead of a Limit block to prevent access other than GET or POST. This is my working .htaccess file.



AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/wordpress/htpasswd
Require Valid-User
<LimitExcept GET POST>
Order allow,deny
Deny from all
</LimitExcept>


Make sure the .ht* files are readable by the web server. I test unauthorized access by changing the user id in the htpasswd file to one I haven't used.






share|improve this answer

























  • Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

    – Charles Chadwick
    Apr 5 '11 at 18:14











  • I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

    – Charles Chadwick
    Apr 6 '11 at 16:39











  • @Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

    – BillThor
    Apr 6 '11 at 21:42











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f255565%2fapache-authentication-inside-a-wordpress-install%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Try closing your browser and then trying to connect. You may have cached credentials that are being used.



If you have multiple secured directories with different passwords, use different values for the Authname.



EDIT: Try moving the Require outside the Limit statement. I always group the Auth definitions with the Require statement in the same block.



Your error seems to indicate the requested resource does not exist or is not readable. Try removing your rewrite modifications for admin. The standard rewrite rules work well with directories and files mixed into the Wordpress installation.



You may want to use a LimitExcept block instead of a Limit block to prevent access other than GET or POST. This is my working .htaccess file.



AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/wordpress/htpasswd
Require Valid-User
<LimitExcept GET POST>
Order allow,deny
Deny from all
</LimitExcept>


Make sure the .ht* files are readable by the web server. I test unauthorized access by changing the user id in the htpasswd file to one I haven't used.






share|improve this answer

























  • Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

    – Charles Chadwick
    Apr 5 '11 at 18:14











  • I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

    – Charles Chadwick
    Apr 6 '11 at 16:39











  • @Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

    – BillThor
    Apr 6 '11 at 21:42















0














Try closing your browser and then trying to connect. You may have cached credentials that are being used.



If you have multiple secured directories with different passwords, use different values for the Authname.



EDIT: Try moving the Require outside the Limit statement. I always group the Auth definitions with the Require statement in the same block.



Your error seems to indicate the requested resource does not exist or is not readable. Try removing your rewrite modifications for admin. The standard rewrite rules work well with directories and files mixed into the Wordpress installation.



You may want to use a LimitExcept block instead of a Limit block to prevent access other than GET or POST. This is my working .htaccess file.



AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/wordpress/htpasswd
Require Valid-User
<LimitExcept GET POST>
Order allow,deny
Deny from all
</LimitExcept>


Make sure the .ht* files are readable by the web server. I test unauthorized access by changing the user id in the htpasswd file to one I haven't used.






share|improve this answer

























  • Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

    – Charles Chadwick
    Apr 5 '11 at 18:14











  • I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

    – Charles Chadwick
    Apr 6 '11 at 16:39











  • @Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

    – BillThor
    Apr 6 '11 at 21:42













0












0








0







Try closing your browser and then trying to connect. You may have cached credentials that are being used.



If you have multiple secured directories with different passwords, use different values for the Authname.



EDIT: Try moving the Require outside the Limit statement. I always group the Auth definitions with the Require statement in the same block.



Your error seems to indicate the requested resource does not exist or is not readable. Try removing your rewrite modifications for admin. The standard rewrite rules work well with directories and files mixed into the Wordpress installation.



You may want to use a LimitExcept block instead of a Limit block to prevent access other than GET or POST. This is my working .htaccess file.



AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/wordpress/htpasswd
Require Valid-User
<LimitExcept GET POST>
Order allow,deny
Deny from all
</LimitExcept>


Make sure the .ht* files are readable by the web server. I test unauthorized access by changing the user id in the htpasswd file to one I haven't used.






share|improve this answer















Try closing your browser and then trying to connect. You may have cached credentials that are being used.



If you have multiple secured directories with different passwords, use different values for the Authname.



EDIT: Try moving the Require outside the Limit statement. I always group the Auth definitions with the Require statement in the same block.



Your error seems to indicate the requested resource does not exist or is not readable. Try removing your rewrite modifications for admin. The standard rewrite rules work well with directories and files mixed into the Wordpress installation.



You may want to use a LimitExcept block instead of a Limit block to prevent access other than GET or POST. This is my working .htaccess file.



AuthType Basic
AuthName "Restricted Access"
AuthUserFile /etc/wordpress/htpasswd
Require Valid-User
<LimitExcept GET POST>
Order allow,deny
Deny from all
</LimitExcept>


Make sure the .ht* files are readable by the web server. I test unauthorized access by changing the user id in the htpasswd file to one I haven't used.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 5 '11 at 21:15

























answered Apr 4 '11 at 23:14









BillThor BillThor

24.9k22662




24.9k22662












  • Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

    – Charles Chadwick
    Apr 5 '11 at 18:14











  • I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

    – Charles Chadwick
    Apr 6 '11 at 16:39











  • @Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

    – BillThor
    Apr 6 '11 at 21:42

















  • Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

    – Charles Chadwick
    Apr 5 '11 at 18:14











  • I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

    – Charles Chadwick
    Apr 6 '11 at 16:39











  • @Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

    – BillThor
    Apr 6 '11 at 21:42
















Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

– Charles Chadwick
Apr 5 '11 at 18:14





Thanks for the response. I did try closing the browser, but no dice. I'm not even being promoted for a user or password. Also, there is only one directly secured via .htaccess.

– Charles Chadwick
Apr 5 '11 at 18:14













I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

– Charles Chadwick
Apr 6 '11 at 16:39





I tried your suggestions, but still no dice. I'm thinking about try to move the admin directory outside of the web root and then just setting up a subdomain.

– Charles Chadwick
Apr 6 '11 at 16:39













@Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

– BillThor
Apr 6 '11 at 21:42





@Charles: You can point a subdomain directly at the admin directory. Have you tried without the .htaccess file. If it doesn't work without the .htaccess file then it won't work with one. On Ubuntu the WordPress software is in /usr/share, but symlinked to /var/www for the web server to access it.

– BillThor
Apr 6 '11 at 21:42

















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f255565%2fapache-authentication-inside-a-wordpress-install%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Vxzy 4cDEdtE,b1AL
xDt4f6D6N84jBWHqxvC,skz ZE,ROT,p jlGN a,ST8N y

Popular posts from this blog

RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020