homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

mod_rewrite external redirect
apache windows mod_rewtrite

10+ Year Member

Msg#: 379 posted 6:17 pm on Sep 10, 2003 (gmt 0)

Has anyone successfully implemented an rewrite map to an external program using the built in functions of mod_rewrite?

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
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.



WebmasterWorld Senior Member 10+ Year Member

Msg#: 379 posted 4:24 pm on Sep 11, 2003 (gmt 0)

Unfortunately, all I have to offer is a warm welcome to WebmasterWorld! :)

We've had very few discussions surrounding the RewriteMap directive. It seems not many here are overly familiar with it. Can anyone offer this new member any suggestions or advice? In other words:

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved