Re: cgi http complete header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I managed to get rid of the .htacces error. I had to add a
RedirectBase /cgi-bin directive to the .htacces and now it's working.
But another problem occured.

Now because mod_rewrite is rewriting my url, the nph prefix for my
script is ignored, so apache add his own header like this:

HTTP/1.1 200 OK
Date: Mon, 06 Apr 2009 23:58:47 GMT
Server: Apache/2.2.3 (CentOS)
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8

How can I use mod_rewrite to pass the request-header to the nph-cgi
and my script preserve its nph properties ?


2009/4/15 Ruben Lihet <evilpus@xxxxxxxxx>:
> Okay, so ..
> I made a little test. In the same directory with my cgi script I write
> a .htaccess file containig this:
>
> Allow from all
> Options +FollowSymLinks
> RewriteEngine on
> RewriteRule ^([^/\.]+)/?$ nph-main.cgi?lid=$1&header=%{HTTP:Range}
>
> The problem now is that when I call the script like this:
> http://web.devel/cgi-bin/rs/24333/
>
> the browser says:
>
> Not Found
> The requested URL /var/www/cgi-bin/rs/nph-main.cgi was not found on this server
>
> which I find very strange because the script is there. Another thing I
> noticed is that apache logs this error:
>
> [Tue Apr 07 00:59:08 2009] [error] [client 192.168.18.1] File does not
> exist: /var/www/html/var
>
> Any hints what could it be ?
> Thanks again!
>
>
> 2009/4/15 Ruben Lihet <evilpus@xxxxxxxxx>:
>> great, thanks, than I'll stick to mod_rewrite and do some digging in the docs!
>>
>> 2009/4/15 André Warnier <aw@xxxxxxxxxx>:
>>> Ruben Lihet wrote:
>>>>
>>>> OK, but can mod_rewrite read the http-header ?
>>>
>>> That's exactly what Eric suggested.
>>>
>>> mod_rewrite reads the http header, and copies its content to an environment
>>> value, which your cgi program can just obtain from its running environment.
>>>
>>> ---------------------------------------------------------------------
>>> 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@xxxxxxxxxxxxxxxx
>>>  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
>>> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>>>
>>>
>>
>>
>>
>> --
>> Lihet Ruben
>> Tel: +40 746 037 017
>> email: lihet.ruben@xxxxxxxxx, evilpus@xxxxxxxxx
>> Web: http://www.faultlessp.net/
>>
>

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux