On Wed, Dec 9, 2020 at 11:35 AM Lentes, Bernd
<[email protected]> wrote:
>
> Hi,
>
> i just setup a Nextcloud instance in conjunction with OnlyOffice.
> NC makes heavy use of mod_rewrite and i try to understand it.
> mod_rewrite isn't easy, so i have some questions and hope for help:
>
> 1. Is a RewriteCond just valid for the consequent rule or for all consequent
> rules ?
just the 1 next rule
> 2. Example: "RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]"
> Are Backreferences also in flags possible ?
yes
> What is the content of $1 ? I thought backreferences belong to parts of
> the pattern which are in parentheses ?
> There are no parentheses.
Looks wrong due to no parens. Likely returns an empty string.
> 3. Example: RewriteCond %{REQUEST_FILENAME}
> !\.(css|js|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav)$
> The ! (exclamation mark) stands for a negotiation. Does that mean this
> condition is only fullfilled if the file does NOT have an extension
> like .css, .js ... ?
yes, it negates the regex. Doing it outside the regex can make many
patterns simpler.
> 4. Example: RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
> What does this rule do ?
> All requests (.*) aren't substituted (-). But ... an environment variable
> HTTP_AUTHORIZATION is set to ... ?
> What means %{HTTP:Authorization} ? Is that also a kind of a backreference ?
the environmment variable is set to the value of the Authorization
request header.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]