Score:0

Server 500 error caused by mod_rewrite with Apache

vu flag

So i've been trying to get this particular script installer to run, and I cannot seem to figure out why it won't process the rewrites properly. In my .htaccess file within the root directory, I have the following:

  RewriteEngine On
# RewriteBase /public
# Uncomment the below 2 lines if you like to add an auto redirect from http:// to https://
# RewriteCond %{HTTPS} off
# RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Remove trailing slash from the URL
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)/$ /$1 [L,R]

  RewriteCond %{REQUEST_URI} !^/install\.php
  RewriteCond %{REQUEST_URI} !public/
  RewriteRule ^(.*)$ public/$1 [L]

It seems that the last line is causing issues, as pages at least load when I comment it out. With it uncommented, it throws a server 500 error, and I cannot find logs for the error anywhere. I believe a 500 error can be displayed if there's an infinite loop, but I don't think I have one. Anything else I try, and I just get a page not found with it trying to redirect to the link specified. Anyone have any ideas? Its driving me up the wall at this point.

kz flag
"pages at least load when I comment it out" - What "pages" are loading if you have not actually been able to run the "installer" yet? Is there a `/public` subdirectory off the root? What does this contain? (Is there another `.htaccess` file at `/public/.htaccess`?) It does not look like what you have posted would generate a rewrite-loop, however, the only way to check the details of the 500 error is to check Apache's error log. "with it trying to redirect to the link specified" - What link/URL?
I sit in a Tesla and translated this thread with Ai:

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.