Forum Moderators: phranque
SetEnvIf REMOTE_ADDR "(.+)" CLIENTIP=$1
SetEnvIf X-Forwarded-For "^([0-9.]+)" CLIENTIP=$1
SetEnvIf True-Client-IP "^([0-9.]+)" CLIENTIP=$1
LogFormat "%{CLIENTIP}e|%l|%u|%t|\"%r\"|%>s|%b|\"%{Referer}i\"|\"%{User-Agent}i\"|%D" combined
RewriteEngine on
RewriteLog /apps/httpd/logs/mod-rewrite-logs/rewrite.log
RewriteLogLevel 5
RewriteCond %{REMOTE_ADDR} !172\.16\.31\.13[0|1]$
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule !^/order$ http://www.example.com/ [R,L]
172.16.31.131|-|-|[01/Apr/2014:20:08:30 -0400]|"GET /"|200|53|"-"|"-"|317
172.16.31.130|-|-|[01/Apr/2014:20:08:32 -0400]|"GET /"|200|53|"-"|"-"|296
198.x.x.x|-|-|[01/Apr/2014:20:08:32 -0400]|"GET / HTTP/1.1"|200|53|"-"|"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"|224
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e59f60/initial] (1) pass through /
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/subreq] (2) init rewrite engine with requested uri /index.html
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/subreq] (1) pass through /index.html
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e5bf70/initial] (2) init rewrite engine with requested uri /
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e5bf70/initial] (3) applying pattern '^/order$' to uri '/'
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e5bf70/initial] (4) RewriteCond: input='172.16.31.130' pattern='!172\\.16\\.31\\.13[0|1]$' => not-matched
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e5bf70/initial] (1) pass through /
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e57f50/subreq] (2) init rewrite engine with requested uri /index.html
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e57f50/subreq] (1) pass through /index.html
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/initial] (2) init rewrite engine with requested uri /
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/initial] (3) applying pattern '^/order$' to uri '/'
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/initial] (4) RewriteCond: input='172.16.31.130' pattern='!172\\.16\\.31\\.13[0|1]$' => not-matched
RewriteCond %{REMOTE_ADDR} !172\.16\.31\.13[0|1]$
SetEnvIf X-Forwarded-For "^([0-9.]+)" CLIENTIP=$1
SetEnvIf True-Client-IP "^([0-9.]+)" CLIENTIP=$1
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule !^/order$ http://www.example.com/ [R,L]
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/initial] (3) applying pattern '^/order$' to uri '/'
172.16.31.130 - - [01/Apr/2014:20:10:49 --0400] [www.example.com/sid#dcc230][rid#e6d700/initial] (4) RewriteCond: input='172.16.31.130' pattern='!172\\.16\\.31\\.13[0|1]$' => not-matched
RewriteCond %{REMOTE_ADDR} !172\.16\.31\.13[0|1]$
SetEnvIf X-Forwarded-For "^([0-9.]+)" CLIENTIP=$1
SetEnvIf True-Client-IP "^([0-9.]+)" CLIENTIP=$1
RewriteCond %{REQUEST_URI} !^/robots\.txt$
RewriteRule !^/order$ http://www.example.com/ [R,L]
In the above rewrite I'm basically saying anything that doesn't start with /order to go back to the home page.
All of the redirect lines I posted are in their own file being called via an Include.
Include conf.d/redirects/*