You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bball Scout <4s...@gmail.com> on 2026/03/03 14:12:13 UTC
[users@httpd] Head scratcher - child htaccess issue
Wordpress multisite subdomain setup. I can't for the life of me figure out how to force apache to allow a child .htaccess for htpasswd authentication 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.
Re: [users@httpd] Head scratcher - child htaccess issue; check AllowOverride
Posted by Nutchanon Wetchasit <xw...@xwindows.in.th>.
On Tue, 3 March 2026, Bball Scout wrote:
> I can't for the life of me figure out how to force apache
> to allow a child .htaccess
Check *root* `.htaccess` to see if there was any non-comment line
which said `AllowOverride`. If there was any [0], pay attention to the word
that _follows_ it in the same line: any word [1] other than `All`
can cause you this problem-- especially when that word was `None`
(which if it was the case, definitely being the root cause of your problem).
^ `AllowOverride None` is a setting which explicitly instructs
the server to *ignore* `.htaccess` in any subdirectory below that level. [2]
However if you found this `AllowOverride` directive, but the value
that followed it was neither `All` nor `None`; then you will have to
copy that entire line [3] over here in your reply, so I could see
which exact things are allowed or disallowed exactly.
(This directive allows quite a lot of fine-tuning,
and it'd be unwise to answer by guessing in the dark)
But in case there wasn't any line in root `.htaccess` saying `AllowOverride`;
then I think you can't avoid attaching your root `.htaccess` file now [2]
if you would like further help on this.
Regards,
Nutchanon Wetchasit
(Just another webmaster using Apache HTTPd)
[0] If you found multiple lines, do tell what these lines are (in full).
[1] Case-insensitive.
[2] RTFM: <https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride>
[3] Or better, attach the entire root `.htaccess` file, with sensitive stuffs
censored with something like ********.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Head scratcher - child htaccess issue
Posted by Tatsuki Makino <ta...@hotmail.com>.
Hello.
Sorry for cutting in from the side again.
When the .htaccess file is not working, it is necessary to check whether the settings are configured to read .htaccess file in the first place.
By writing random characters in the .htaccess file, we can make the server always return a 500 :)
A server that continues to operate normally without returning a 500 error is not reading the .htaccess file.
The server itself must be configured, and the necessary permissions are required for that.
Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Head scratcher - child htaccess issue
Posted by Frank Gingras <th...@apache.org>.
On Tue, Mar 3, 2026 at 11:27 AM <4s...@gmail.com> wrote:
> I don’t 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
>
>
>
> *From:* Frank Gingras <th...@apache.org>
> *Sent:* Tuesday, March 3, 2026 11:15 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] Head scratcher - child htaccess issue
>
>
>
>
>
>
>
> On Tue, Mar 3, 2026 at 10:57 AM <4s...@gmail.com> 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=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
>
> RewriteBase /
>
> RewriteRule ^index\.php$ - [L]
>
>
>
> # add a trailing slash to /wp-admin
>
> RewriteRule ^wp-admin$ wp-admin/ [R=301,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 <ye...@ymkatz.net>
> *Sent:* Tuesday, March 3, 2026 9:54 AM
> *To:* users@httpd.apache.org
> *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 AM Bball Scout <4s...@gmail.com> wrote:
>
> Wordpress multisite subdomain setup. I can't for the life of me figure out
> how to force apache to allow a child .htaccess for htpasswd authentication
> 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.
RE: [users@httpd] Head scratcher - child htaccess issue
Posted by 4s...@gmail.com.
I don’t 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
From: Frank Gingras <th...@apache.org>
Sent: Tuesday, March 3, 2026 11:15 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Head scratcher - child htaccess issue
On Tue, Mar 3, 2026 at 10:57 AM <4seamer@gmail.com <ma...@gmail.com> > 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=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,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 <yehuda@ymkatz.net <ma...@ymkatz.net> >
Sent: Tuesday, March 3, 2026 9:54 AM
To: users@httpd.apache.org <ma...@httpd.apache.org>
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 AM Bball Scout <4seamer@gmail.com <ma...@gmail.com> > wrote:
Wordpress multisite subdomain setup. I can't for the life of me figure out how to force apache to allow a child .htaccess for htpasswd authentication 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?
Re: [users@httpd] Head scratcher - child htaccess issue
Posted by Frank Gingras <th...@apache.org>.
On Tue, Mar 3, 2026 at 10:57 AM <4s...@gmail.com> 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=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
>
> RewriteBase /
>
> RewriteRule ^index\.php$ - [L]
>
>
>
> # add a trailing slash to /wp-admin
>
> RewriteRule ^wp-admin$ wp-admin/ [R=301,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 <ye...@ymkatz.net>
> *Sent:* Tuesday, March 3, 2026 9:54 AM
> *To:* users@httpd.apache.org
> *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 AM Bball Scout <4s...@gmail.com> wrote:
>
> Wordpress multisite subdomain setup. I can't for the life of me figure out
> how to force apache to allow a child .htaccess for htpasswd authentication
> 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?
RE: [users@httpd] Head scratcher - child htaccess issue
Posted by 4s...@gmail.com.
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=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,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 <ye...@ymkatz.net>
Sent: Tuesday, March 3, 2026 9:54 AM
To: users@httpd.apache.org
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 AM Bball Scout <4seamer@gmail.com <ma...@gmail.com> > wrote:
Wordpress multisite subdomain setup. I can't for the life of me figure out how to force apache to allow a child .htaccess for htpasswd authentication 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.
Re: [users@httpd] Head scratcher - child htaccess issue
Posted by Yehuda Katz <ye...@ymkatz.net>.
What is in your root directory .htaccess?
What is in your VirtualHost configuration?
- Y
On Tue, Mar 3, 2026 at 9:25 AM Bball Scout <4s...@gmail.com> wrote:
> Wordpress multisite subdomain setup. I can't for the life of me figure out
> how to force apache to allow a child .htaccess for htpasswd authentication
> 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.
>