Please sign in to comment.
Rewrite `?` as `%3F`
As this is now a static site, the URLs point to files with those names, e.g. `http://spaconference.org/mediawiki/index.php?title=SpaTwoThousandAndFifteenOutput`, i.e. the filenames actually contain a `?`. However, the `?` reserved meaning in the browser, to indicate a query string. So it will not be looking for a file that is called index.php?something. This change rewrites the `?`s to `%3F`s, so the browser can find the files. So I can remember what this means next time, let's spell this out. `RewriteCond` is the condition under which the following rewrite rule will be applied. "The first argument is a variable describing a characteristic of the request, the second argument is a regular expression that must match the variable" (https://httpd.apache.org/docs/trunk/rewrite/intro.html). So what we are saying here is: "when there is a query string consisting of one or more characters". `RewriteRule` is what we should do in that case. The rewrite rule is made up of three parts: a pattern, a subsitution, and optional flags. In this case, the pattern is where the path (i.e. up to the query string) is `index.php`, and the substitution is $1 (i.e. `index.php`), plus `%3F` (escaped as % has meaning), plus `%1` which is the match for the `RewriteCond` (i.e. the former query string). The [L] flag means last – stop here and don't evaluate any other rules if you've done this one.
- Loading branch information...