php - Local Proxy not always working


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 it would give a 302 and redirect with .

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 :

User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)
Accept: */*
Accept-Encoding: identity
Accept-Language: en-IN
Accept-Charset: *

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"
<html xmlns="" lang="en" xml:lang="en">
<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;}

<h1>Object not found!</h1>

    The requested URL was not found on this server.

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

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


<h2>Error 404</h2>
  <a href="/"></a><br />
  <span>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15</span>

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=
Content-Type: text/html; charset=iso-8859-1
Content-Length: 359

<title>302 Found</title>
<p>The document has moved <a href="http://localhost/directdl/?url=">here</a>.</p>
<address>Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.5.15 Server at Port 80</address>

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


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.