FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Apache and php to show http request headers.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Apache and php to show http request headers. [message #178495 is a reply to message #178494] Mon, 25 June 2012 13:41 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 6/25/2012 9:36 AM, Tony Mountifield wrote:
> In article <klslb9-ogk(dot)ln1(at)luuk(dot)invalid(dot)lan>, Luuk <luuk(at)invalid(dot)lan> wrote:
>> On 25-06-2012 12:15, brumik wrote:
>>>
>>> I need to test various http requests from an application and am using
>>> Apache/PHP on ubuntu to display the http request headers. The
>>> application proxy forwards http requests to the apache server's IP
>>> address like as follows:
>>>
>>> 192.168.40.1/test/test.html
>>>
>>> where 192.168.40.1 is the apache server.
>>>
>>> I have a php script to dump the headers as follows:
>>>
>>> <?php
>>> foreach($_SERVER as $h=>$v)
>>> #if(ereg('HTTP_(.+)',$h,$hp))
>>> echo "<li>$h = $v</li>\n";
>>> header('Content-type: text/html');
>>> ?>
>>>
>>> The problem is that to show the headers, I redirect 192.168.40.1/* to
>>> the above index.php page using the following redirect:
>>>
>>> Options +FollowSymlinks
>>> RewriteEngine on
>>> RewriteCond %{REQUEST_URI} !/index.php$
>>>
>>> RewriteRule $ /index.php [R=302,L]
>>>
>>> However the php request headers page always shows the URI as /
>>> index.php as opposed to the 'original' URI requested (/test/
>>> test.html).
>>>
>>> How can I get it to show the 'original' URI requested? is this
>>> something that can be done in PHP or is it apache specific?
>>>
>>
>> Its apache, because it is redirecting, so PHP does only know about the
>> redirected request, and does have no knowledge of how this request
>> reached PHP.
>
> You could try the Proxy flag in the RewriteRule:
>
> RewriteRule $ http://localhost/index.php [P,L]
>
> Cheers
> Tony
>

He can try a lot of things which won't work.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Simulating a Form Method=Post submission in PHP
Next Topic: File upload on iOS
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 11:47:10 GMT 2024

Total time taken to generate the page: 0.04487 seconds