Re: Head scratcher - child htaccess issue

Frank Gingras <[email protected]> Tue, 3 Mar 2026 11:52:54 -0500
Newsgroups gmane.comp.apache.user
Message-ID <CAOY50mtaEQrqu+8jS7P=ZE+g2EJVKLVeBSgqfK-aVUW+jv=BmA@mail.gmail.com>
--00000000000098deec064c2189e6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 3, 2026 at 11:27=E2=80=AFAM <[email protected]> wrote:

> I don=E2=80=99t have a rewrite log that I know of. Nothing in error.log, =
nothing
> in my debug.log, nothing shows up on console or networking except the 404=
.
> If I rename the root htaccess, I can pull up the files in the subdirector=
y.
> If I rename the subdirectory htaccess that has the htpasswd requirement, =
I
> still get a 404. Weird
>
>
>
> *From:* Frank Gingras <[email protected]>
> *Sent:* Tuesday, March 3, 2026 11:15 AM
> *To:* [email protected]
> *Subject:* Re: [users@httpd] Head scratcher - child htaccess issue
>
>
>
>
>
>
>
> On Tue, Mar 3, 2026 at 10:57=E2=80=AFAM <[email protected]> wrote:
>
> Standard vhost setup on Cpanel for almalinux
>
> Root htaccess:
>
> Options -Indexes
>
>
>
> # BEGIN WordPress Multisite
>
> # Using subdomain network type
>
> <IfModule mod_rewrite.c>
>
> RewriteEngine On
>
> RewriteRule .* - [E=3DHTTP_AUTHORIZATION:%{HTTP:Authorization}]
>
> RewriteBase /
>
> RewriteRule ^index\.php$ - [L]
>
>
>
> # add a trailing slash to /wp-admin
>
> RewriteRule ^wp-admin$ wp-admin/ [R=3D301,L]
>
>
>
> RewriteCond %{REQUEST_FILENAME} -f [OR]
>
> RewriteCond %{REQUEST_FILENAME} -d
>
> RewriteRule ^ - [L]
>
> RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
>
> RewriteRule ^(.*\.php)$ $1 [L]
>
> RewriteRule . index.php [L]
>
> </IfModule>
>
> # END WordPress Multisite
>
>
>
> *From:* Yehuda Katz <[email protected]>
> *Sent:* Tuesday, March 3, 2026 9:54 AM
> *To:* [email protected]
> *Subject:* Re: [users@httpd] Head scratcher - child htaccess issue
>
>
>
> What is in your root directory .htaccess?
>
> What is in your VirtualHost configuration?
>
>
>
> - Y
>
>
>
> On Tue, Mar 3, 2026 at 9:25=E2=80=AFAM Bball Scout <[email protected]> wr=
ote:
>
> Wordpress multisite subdomain setup. I can't for the life of me figure ou=
t
> how to force apache to allow a child .htaccess for htpasswd authenticatio=
n
> in a subdirectory of a WP multisite domain. Ie:
>
>
>
> / [root WP server with its own .htaccess]
>
> /directory1 [child .htaccess for htpasswd use]
>
>
>
> Any attempt to display a file in /directory1 apache gives a 404.
>
>
>
> I've tried rewrites in the parent .htaccess up the creek to no avail.
>
>
>
> Love suggestions.
>
>
>
> What does the rewrite log say, exactly?
>

In that case, you should enable the rewrite log first.

As for the 404s, make sure the log level is verbose enough, and it'll show
the path that was being requested in the error log.

--00000000000098deec064c2189e6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Mar 3, =
2026 at 11:27=E2=80=AFAM &lt;<a href=3D"mailto:[email protected]">4seamer@g=
mail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><div class=3D"msg2080852822632925090"><div lang=3D"EN-US" style=3D"=
overflow-wrap: break-word;"><div class=3D"m_2080852822632925090WordSection1=
"><p class=3D"MsoNormal">I don=E2=80=99t have a rewrite log that I know of.=
 Nothing in error.log, nothing in my debug.log, nothing shows up on console=
 or networking except the 404. If I rename the root htaccess, I can pull up=
 the files in the subdirectory. If I rename the subdirectory htaccess that =
has the htpasswd requirement, I still get a 404. Weird<u></u><u></u></p><p =
class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div style=3D"border-right:none=
;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);=
padding:3pt 0in 0in"><p class=3D"MsoNormal"><b><span style=3D"font-size:11p=
t;font-family:Calibri,sans-serif">From:</span></b><span style=3D"font-size:=
11pt;font-family:Calibri,sans-serif"> Frank Gingras &lt;<a href=3D"mailto:t=
[email protected]" target=3D"_blank">[email protected]</a>&gt; <br><b>Sent:<=
/b> Tuesday, March 3, 2026 11:15 AM<br><b>To:</b> <a href=3D"mailto:users@h=
ttpd.apache.org" target=3D"_blank">[email protected]</a><br><b>Subject=
:</b> Re: [users@httpd] Head scratcher - child htaccess issue<u></u><u></u>=
</span></p></div><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p><div><div><=
p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><p class=3D"MsoNormal">=
<u></u>=C2=A0<u></u></p><div><div><p class=3D"MsoNormal">On Tue, Mar 3, 202=
6 at 10:57<span style=3D"font-family:Arial,sans-serif">=E2=80=AF</span>AM &=
lt;<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
</a>&gt; wrote:<u></u><u></u></p></div><blockquote style=3D"border-top:none=
;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204=
);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><di=
v><p class=3D"MsoNormal" style=3D"margin-bottom:12pt">Standard vhost setup =
on Cpanel for almalinux<br><br>Root htaccess:<u></u><u></u></p><p class=3D"=
MsoNormal">Options -Indexes <u></u><u></u></p><p class=3D"MsoNormal">=C2=A0=
<u></u><u></u></p><p class=3D"MsoNormal"># BEGIN WordPress Multisite<u></u>=
<u></u></p><p class=3D"MsoNormal"># Using subdomain network type<u></u><u><=
/u></p><p class=3D"MsoNormal">&lt;IfModule mod_rewrite.c&gt;<u></u><u></u><=
/p><p class=3D"MsoNormal">RewriteEngine On<u></u><u></u></p><p class=3D"Mso=
Normal">RewriteRule .* - [E=3DHTTP_AUTHORIZATION:%{HTTP:Authorization}]<u><=
/u><u></u></p><p class=3D"MsoNormal">RewriteBase /<u></u><u></u></p><p clas=
s=3D"MsoNormal">RewriteRule ^index\.php$ - [L]<u></u><u></u></p><p class=3D=
"MsoNormal">=C2=A0<u></u><u></u></p><p class=3D"MsoNormal"># add a trailing=
 slash to /wp-admin<u></u><u></u></p><p class=3D"MsoNormal">RewriteRule ^wp=
-admin$ wp-admin/ [R=3D301,L]<u></u><u></u></p><p class=3D"MsoNormal">=C2=
=A0<u></u><u></u></p><p class=3D"MsoNormal">RewriteCond %{REQUEST_FILENAME}=
 -f [OR]<u></u><u></u></p><p class=3D"MsoNormal">RewriteCond %{REQUEST_FILE=
NAME} -d<u></u><u></u></p><p class=3D"MsoNormal">RewriteRule ^ - [L]<u></u>=
<u></u></p><p class=3D"MsoNormal">RewriteRule ^(wp-(content|admin|includes)=
.*) $1 [L]<u></u><u></u></p><p class=3D"MsoNormal">RewriteRule ^(.*\.php)$ =
$1 [L]<u></u><u></u></p><p class=3D"MsoNormal">RewriteRule . index.php [L]<=
u></u><u></u></p><p class=3D"MsoNormal">&lt;/IfModule&gt;<u></u><u></u></p>=
<p class=3D"MsoNormal"># END WordPress Multisite<u></u><u></u></p><p class=
=3D"MsoNormal">=C2=A0<u></u><u></u></p><div style=3D"border-right:none;bord=
er-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);paddi=
ng:3pt 0in 0in"><p class=3D"MsoNormal"><b><span style=3D"font-size:11pt;fon=
t-family:Calibri,sans-serif">From:</span></b><span style=3D"font-size:11pt;=
font-family:Calibri,sans-serif"> Yehuda Katz &lt;<a href=3D"mailto:yehuda@y=
mkatz.net" target=3D"_blank">[email protected]</a>&gt; <br><b>Sent:</b> Tue=
sday, March 3, 2026 9:54 AM<br><b>To:</b> <a href=3D"mailto:[email protected]=
che.org" target=3D"_blank">[email protected]</a><br><b>Subject:</b> Re=
: [users@httpd] Head scratcher - child htaccess issue</span><u></u><u></u><=
/p></div><p class=3D"MsoNormal">=C2=A0<u></u><u></u></p><div><p class=3D"Ms=
oNormal">What is in your root directory .htaccess?<u></u><u></u></p><div><p=
 class=3D"MsoNormal">What is in your VirtualHost configuration?<u></u><u></=
u></p><div><div><p class=3D"MsoNormal">=C2=A0<u></u><u></u></p></div><div><=
p class=3D"MsoNormal">- Y<u></u><u></u></p></div></div></div></div><p class=
=3D"MsoNormal">=C2=A0<u></u><u></u></p><div><div><p class=3D"MsoNormal">On =
Tue, Mar 3, 2026 at 9:25<span style=3D"font-family:Arial,sans-serif">=E2=80=
=AF</span>AM Bball Scout &lt;<a href=3D"mailto:[email protected]" target=3D=
"_blank">[email protected]</a>&gt; wrote:<u></u><u></u></p></div><blockquot=
e style=3D"border-top:none;border-right:none;border-bottom:none;border-left=
:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8p=
t"><div><div><div><p class=3D"MsoNormal"><span style=3D"color:black">Wordpr=
ess multisite subdomain setup. I can&#39;t for the life of me figure out ho=
w to force apache to allow a child .htaccess for htpasswd authentication in=
 a subdirectory of a WP multisite domain. Ie:</span><u></u><u></u></p></div=
><div><p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0</span><u></=
u><u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"color:black">=
/ [root WP server with its own .htaccess]</span><u></u><u></u></p></div><di=
v><p class=3D"MsoNormal"><span style=3D"color:black">/directory1 [child .ht=
access for htpasswd use]</span><u></u><u></u></p></div><div><p class=3D"Mso=
Normal"><span style=3D"color:black">=C2=A0</span><u></u><u></u></p></div><d=
iv><p class=3D"MsoNormal"><span style=3D"color:black">Any attempt to displa=
y a file in /directory1 apache gives a 404.=C2=A0</span><u></u><u></u></p><=
/div><div><p class=3D"MsoNormal"><span style=3D"color:black">=C2=A0</span><=
u></u><u></u></p></div><div><p class=3D"MsoNormal"><span style=3D"color:bla=
ck">I&#39;ve tried rewrites in the parent .htaccess up the creek to no avai=
l.=C2=A0</span><u></u><u></u></p></div><div><p class=3D"MsoNormal"><span st=
yle=3D"color:black">=C2=A0</span><u></u><u></u></p></div><div><p class=3D"M=
soNormal"><span style=3D"color:black">Love suggestions.</span><u></u><u></u=
></p></div></div></div></blockquote></div></div></div></div></blockquote><d=
iv><p class=3D"MsoNormal"><u></u>=C2=A0<u></u></p></div><div><p class=3D"Ms=
oNormal">What does the rewrite log say, exactly?=C2=A0</p></div></div></div=
></div></div></div></blockquote><div><br></div><div>In that case, you shoul=
d enable the rewrite log first.</div><div><br></div><div>As for the 404s, m=
ake sure the log level is verbose enough, and it&#39;ll show the path that =
was being requested in the error log.=C2=A0</div></div></div>

--00000000000098deec064c2189e6--