php - Local Proxy not always working

216

I made a code which works as a HTTP proxy script but i use it in another form . I have some links which need to be redirected when i try to open .

For example : if i try to open http://www.example.com/myfile.exe it would give a 302 and redirect with http://special.site/url?=http://www.example.com/myfile.exe .

Well the good thing is it is working fine in firefox but it is not working in IDM (internet download manager ) it simply shows 404 error with a message "Object not found " , after that i tried to put all the work in .htaccess which is quite good as it do all the work in a single .htaccess .

Details of my .htaccess code:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteCond %{REQUEST_URI} !^/index.php[nc]
RewriteRule ^(.+)$ http://localhost/directdl/?url=http://%{HTTP_HOST}%{REQUEST_URI} [r=302,QSA,nc]

Details - which i get when try to open any link with my local proxy

HTTP request :

GET http://uploaded.net/file/yueavjnq HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
Host: uploaded.net
Accept: */*
Accept-Encoding: identity
Accept-Language: en-IN
Accept-Charset: *
Referer: http://uploaded.net/file/

HTTP response:

HTTP/1.1 404 Not Found
Date: Thu, 12 Mar 2015 23:48:19 GMT
Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Content-Type: text/html; charset=utf-8
Content-Language: en
Content-Length: 1195

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Object not found!</title>
<link rev="made" href="mailto:[email protected]" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>

<body>
<h1>Object not found!</h1>
<p>


    The requested URL was not found on this server.



    The link on the
    <a href="http://uploaded.net/file/">referring
    page</a> seems to be wrong or outdated. Please inform the author of
    <a href="http://uploaded.net/file/">that page</a>
    about the error.



</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:[email protected]">webmaster</a>.

</p>

<h2>Error 404</h2>
<address>
  <a href="/">uploaded.net</a><br />
  <span>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15</span>
</address>
</body>
</html>

Same request used by another application respose got :

HTTP/1.1 302 Found
Date: Thu, 12 Mar 2015 23:51:00 GMT
Server: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15
Location: http://localhost/directdl/?url=http://uploaded.net/file/yueavjnq
Content-Type: text/html; charset=iso-8859-1
Content-Length: 359

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://localhost/directdl/?url=http://uploaded.net/file/yueavjnq">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 Server at uploaded.net Port 80</address>
</body></html>

What Goal i want to achieve . Whenever i put any link on my Internet Download Manager it redirect it to "http://localhost/directdl/?url="URl this format , it can be done by a proxy where it will redirect as i want . It works at evrywhere only not in IDM (Internet Download manager ) and IDM is the only application which i wished to use it .

People are also looking for solutions to the problem: html - Checkbox Value in form coming over blank PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.