httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricardo13 <ricardoogra...@gmail.com>
Subject Re: [users@httpd] RewriteMap PRG By Example Using C
Date Wed, 29 Apr 2009 17:25:46 GMT

Please !!!

Help me !!!!

Somebody has some example of RewriteMap using external program in C !!!
There are some example in 
http://www.wellho.net/resources/ex.php4?item=a603/andy PHP .

Thank You 

Ricardo


ricardo13 wrote:
> 
> Hi,
> 
> I thought that if I typed "localhost/1" in browser, the program (file) in
> mod_rewrite (RewriteMap) mapped from /1 to /index.html
> 
> But, Happen 400 Bad Request.
> 
> Thank you
> 
> Ricardo
> 
> 
> Eric Covener wrote:
>> 
>> On Tue, Apr 28, 2009 at 2:17 PM, ricardo13 <ricardoogrande@gmail.com>
>> wrote:
>>>
>>> Hi all,
>>> I'm doing examples with mod_rewrite, I'm using directive RewriteMap
>>> I did a simple program in C
>>>
>>> #include <stdio.h>
>>> int main() {
>>>  int id = 0;
>>>  fscanf(stdin, "%d", &id);
>>>  switch(id) {
>>>    case 1: fprintf(stdout, "/index.html");
>>>    break;
>>>
>>>    case 2: fprintf(stdout, "/new.html");
>>>    break;
>>>
>>>    case 3: fprintf(stdout, "/teste.php?var=4/8");
>>>    break;
>>>  }
>>>  fflush(stdout);
>>>  return 0;
>>> }
>> 
>> You need to loop and you probably need to read up until a newline.
>> 
>>>
>>> My httpd.conf:
>>>  RewriteEngine on
>>>  RewriteLock /usr/local/apache2/logs/file.lock
>>>  RewriteMap prgmap prg:/usr/local/apache2/file
>>>  RewriteRule ^/(.*) ${prgmap:$1}
>>>
>>> My program in C called file
>>> In my folder htdocs I have three files (index.html, new.html and
>>> test.php).
>>> When typed in the browser "http//localhost/1" I think that URL is mapped
>>> to
>>> address "http://localhost/index.html"
>>>
>>> What happen ?? Is test right ??
>> 
>> I don't know, what happened?
>> 
>> -- 
>> Eric Covener
>> covener@gmail.com
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/RewriteMap-PRG-By-Example-Using-C-tp23283305p23296344.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message