Forum Moderators: phranque
I am attempting to use an external program for load balancing/failover but I am running into a strange problem. When the URL is rewritten, I get an access forbidden error - mod rewrite is proxying the request with an external %0D on the end.
We run Apache 2.0.43 on Windows, so I am unable to get a perl program to run (as called from Apache), so I've written a small program in C to provide the redirect.
My conf lines read like:
rewriteengine on
rewritelog /apache2/myapache/rw.log
rewriteloglevel 3
rewritemaplbprg:/apache2/myApache/pb.exe
rewriterule ^/(.+)$${lb:$1}[P,L]
where pb.exe is an executable which, at this time, accepts the url on stdin and returns a url:
#include <iostream>
int main()
{
char ch[] = { "empty" };
while (ch)
{
std::cin >> ch;
std::cout << "http://wc-dev.healthsystem.virginia.edu/internet/index.html";
std::cout << std::endl;
}
return 0;
}
If this makes no sense to you, but you know of a program that works similarly or have a suggestion about how to make map:txt work, I would be grateful for your input.