1

Concrete5 provides this config dump to insert an elided 'index.php/' at the beginning of all URLs:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>

But why does the RewriteRule work?

  1. Why does the replacement string go at the beginning of the URL, and where does the extra '/' come from? E.g http://<host>/foo ==> http://<host>/index.php/foo.
  2. Why doesn't this rule require [QSA] to preserve query string parameters?

The rule objectively does handle both these cases correctly, but I cannot deduce from the Apache documentation why it does, and would appreciate some patient instructor reading the relevant sections of the farking manual to me.

BobHy
  • 1,575
  • 10
  • 23

0 Answers0