|
The truth is I dont have control over the subdomain. So I tried using the http:via command on the first rule:
RewriteCond %{HTTP_HOST} ^blog.test.net [NC]
RewriteCond %{HTTP:VIA} !^192.168.1.3$ [NC]
RedirectRule ^(.*)$ http://www.test.net/blog$1 [R=301]
RewriteCond %{HTTP_HOST} ^www\.test\.net$ [I]
RewriteCond %{HTTP_URL} /blog
ProxyPass ^(.*)$ http://blog.test.net$1 [U,I]
The loops has ended, but its not redirecting, I'm getting the following. What is "GetServerVariable: cannot find that variable"? If the http:via has the ! and => TRUE, why does the rule apply?
Thu Jan 19 12:32:45 - 1396 - DoRewrites
Thu Jan 19 12:32:45 - 1396 - DoRewrites: Url (decoded): '/
'Thu Jan 19 12:32:45 - 1396 - EvaluateRules: depth=0
Thu Jan 19 12:32:45 - 1396 - EvaluateRules: RewriteBase is empty (root vdir)
Thu Jan 19 12:32:45 - 1396 - EvaluateRules: Rule 1: 2 match
Thu Jan 19 12:32:45 - 1396 - EvaluateRules: Rule 1: evaluating conditionThu Jan 19 12:32:45 - 1396 - ApplyUrlEncoding: out 'blog.test.net'
Thu Jan 19 12:32:45 - 1396 - EvalCondition: Cond t(%{HTTP_HOST}) op(~) p(blog.test.net) => TRUE
Thu Jan 19 12:32:45 - 1396 - GetServerVariable: cannot find that variable
Thu Jan 19 12:32:45 - 1396 - GetServerVariable: cannot find that variableThu Jan 19 12:32:45 - 1396 - ApplyUrlEncoding: out ''
Thu Jan 19 12:32:45 - 1396 - EvalCondition: Cond t(%{HTTP:VIA}) op(~) p(!^192.168.1.3$) => TRUE
Thu Jan 19 12:32:45 - 1396 - EvalConditionList: rule 1, TRUE, Rule will apply
Thu Jan 19 12:32:45 - 1396 - ApplyUrlEncoding: out 'http://www.test.net/blog/'
Thu Jan 19 12:32:45 - 1396 - EvaluateRules: Result (length 38): http://www.test.net/blog/
Thu Jan 19 12:32:45 - 1396 - EvaluateRules: returning 1301
Thu Jan 19 12:32:45 - 1396 - DoRewrites: Redirect (code=301) Url to: 'http://www.test.net/blog/'
|