Score:1

Default WordPress .htaccess rewrites causes default server page to load due to no default index page present for the root URL

hn flag
J O

I could really do with some help here please. I know this is a WordPress issue now through testing. If I allow .htaccess to process rewrites on my Wordpress sites by adding AllowOverride FileInfo to the https conf file, my WordPress sites all redirect to the AlmaLinux default page due to no default index page present for the root URL. If I don't allow it to process the .htaccess it works but I need to use .htaccess What is going on here?

Here is my WordPress site .htaccess file that would get processed if I uncomment AllowOverride FileInfo and then it breaks WordPress by redirecting everything to the AlmaLinux default page. This is created by WordPress itself

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Thank you so much in advance for anyone who can dig me out of this.

Score:1
hn flag
J O

FIXED I should have looked in Apache error logs in the first place. I just did and found:

[Wed Mar 29 23:17:59.234743 2023] [rewrite:error] [pid 133333:tid 133444] [client 81.11.11.11:53583] AH00670: Options FollowSymLinks and SymLinksIfOwnerMatch are both off, so the RewriteRule directive is also forbidden due to its similar ability to circumvent directory restrictions : /var/www/www.mysite.com/

Doing a search for the error we see: If your server is set with both FollowSymLinks and SymLinksIfOwnerMatch off, then rewrite rules will stop working

Simple as that!

So I went through all my sites in the Apache conf files and changed: Options None to: Options SymLinksIfOwnerMatch

Fixed

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.