12

Do the apache docs have a full list of these variables? Or is there some way that I can find out what they are in apache? The variables are things like %{Referer} and %{User-agent}.

  • 1
    Variables allowed in `RewriteCond` are not the same thing as environment variables. Which one are you interested in? – Shane Madden Jun 28 '12 at 01:06

3 Answers3

8

Dave from addedbytes wrote this great cheatsheet: https://www.cheatography.com/davechild/cheat-sheets/mod-rewrite/

jmiserez
  • 103
  • 4
AliGibbs
  • 2,323
  • 21
  • 34
6

Apache HTTP Server v2.4 documentation provides expression parser variables here that includes the %{HTTP_REFERER} and %{HTTP_USER_AGENT} aspects you were seeking.

Also, keep in mind, the docs mention this and other details:

Note that the value of a variable may depend on the phase of the request processing in which it is evaluated.

A bit different but somewhat related is v2.4 documentation on environment variables that affect the Apache HTTP Server.

jmmygoggle
  • 161
  • 1
  • 3
0

A bunch of standard variables are listed here:

https://httpd.apache.org/docs/2.4/expr.html

Modules can define their own variables as well:

https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#envvars

dannyw
  • 353
  • 3
  • 5