<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How To Get Redirect URL In PHP</title>
	<atom:link href="http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/</link>
	<description>Slightly Advanced Computer Stuff (and some magic)</description>
	<lastBuildDate>Tue, 16 Mar 2010 20:24:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-2/#comment-33911</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Sat, 06 Mar 2010 17:21:35 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-33911</guid>
		<description>See &lt;a href=&quot;http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-31127&quot; rel=&quot;nofollow&quot;&gt;Emprivo&#039;s comment&lt;/a&gt; about detecting JavaScript redirects. You could use a similar approach to detect Meta refresh redirects, too.</description>
		<content:encoded><![CDATA[<p>See <a href="http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-31127" rel="nofollow">Emprivo&#8217;s comment</a> about detecting JavaScript redirects. You could use a similar approach to detect Meta refresh redirects, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-33910</link>
		<dc:creator>George</dc:creator>
		<pubDate>Sat, 06 Mar 2010 17:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-33910</guid>
		<description>Great script, it does not currently detect Meta Refresh redirects though. There are quite a few of those as well unfortunately. :)</description>
		<content:encoded><![CDATA[<p>Great script, it does not currently detect Meta Refresh redirects though. There are quite a few of those as well unfortunately. <img src='http://w-shadow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: White Shadow</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-33203</link>
		<dc:creator>White Shadow</dc:creator>
		<pubDate>Wed, 30 Dec 2009 21:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-33203</guid>
		<description>If at all possible, don&#039;t. Anti-bot measures are sometimes very sophisticated, and finding a way to fool them can take a lot of time. Is that one site really worth it?

That said, the first thing I&#039;d suggest would be using a HTTP sniffer to check what headers a normal browser sends when opening that site, and modifying the script to send the same or similar headers. This might fool a primitive bot detector.</description>
		<content:encoded><![CDATA[<p>If at all possible, don&#8217;t. Anti-bot measures are sometimes very sophisticated, and finding a way to fool them can take a lot of time. Is that one site really worth it?</p>
<p>That said, the first thing I&#8217;d suggest would be using a HTTP sniffer to check what headers a normal browser sends when opening that site, and modifying the script to send the same or similar headers. This might fool a primitive bot detector.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JC</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-33196</link>
		<dc:creator>JC</dc:creator>
		<pubDate>Wed, 30 Dec 2009 19:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-33196</guid>
		<description>This is a great script. Works perfectly for most redirections I find. I&#039;m working with one instance where the site somehow knows that this is essentially a bot testing the link and not a normal browser. I have this same problem using CURL-based solutions.

Any ideas how I can determine the final URL in a way that will fool these sites into redirecting as normal? Somehow it needs to simulate how the site handles the situation when a normal user visits the original URL. Ideas?</description>
		<content:encoded><![CDATA[<p>This is a great script. Works perfectly for most redirections I find. I&#8217;m working with one instance where the site somehow knows that this is essentially a bot testing the link and not a normal browser. I have this same problem using CURL-based solutions.</p>
<p>Any ideas how I can determine the final URL in a way that will fool these sites into redirecting as normal? Somehow it needs to simulate how the site handles the situation when a normal user visits the original URL. Ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TMG</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-33095</link>
		<dc:creator>TMG</dc:creator>
		<pubDate>Wed, 23 Dec 2009 06:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-33095</guid>
		<description>Nice clean script.  I added a couple of lines to handle websites that connect, but take way too long to load (so you can skip them):

while(!feof($sock)) $response .= fread($sock, 8192);

becomes:

	stream_set_timeout($sock, 1);
	while(!feof($sock)) {
		$meta = stream_get_meta_data($sock);
		if ($meta[&#039;timed_out&#039;]) break;
		$response .= fread($sock, 8192);
	}

(set the stream timeout to whatever you want in seconds, or 0,X where X is ms)</description>
		<content:encoded><![CDATA[<p>Nice clean script.  I added a couple of lines to handle websites that connect, but take way too long to load (so you can skip them):</p>
<p>while(!feof($sock)) $response .= fread($sock, 8192);</p>
<p>becomes:</p>
<p>	stream_set_timeout($sock, 1);<br />
	while(!feof($sock)) {<br />
		$meta = stream_get_meta_data($sock);<br />
		if ($meta['timed_out']) break;<br />
		$response .= fread($sock, 8192);<br />
	}</p>
<p>(set the stream timeout to whatever you want in seconds, or 0,X where X is ms)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manish singh</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-32643</link>
		<dc:creator>Manish singh</dc:creator>
		<pubDate>Sat, 28 Nov 2009 12:27:37 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-32643</guid>
		<description>HI Emprivo, 
I used your code but its not work, when I used below mention link its give me original url not redirected url.


I have Linux OS and Mozilla browser

and URL=http://legal-tb.auto-graphics.com/loginModule/Referrer.aspx?myses=16965&amp;w=S&amp;k=712481&amp;cuid=legal&amp;cusrvr=cassiopia&amp;s=wdb&amp;ltis=4&amp;ltype=f&amp;lmethod=1001&amp;url=https%3a%2f%2fwww.lexis.com%2fresearch%2fretrieve%3f_m%3dd8ca55f1090c4475c89026e5fbc07401%26docnum%3d4%26_fmtstr%3dFULL%26_startdoc%3d1%26wchp%3ddGLbVzz-zSkAz%26_md5%3de4dd13f6ce45966fc41fc00c665ad0c1&amp;bof=0&amp;clientId=ACME-ACME2-C1235


is the problem of Linux OS


Please advise me where is I am wrong</description>
		<content:encoded><![CDATA[<p>HI Emprivo,<br />
I used your code but its not work, when I used below mention link its give me original url not redirected url.</p>
<p>I have Linux OS and Mozilla browser</p>
<p>and URL=http://legal-tb.auto-graphics.com/loginModule/Referrer.aspx?myses=16965&amp;w=S&amp;k=712481&amp;cuid=legal&amp;cusrvr=cassiopia&amp;s=wdb&amp;ltis=4&amp;ltype=f&amp;lmethod=1001&amp;url=https%3a%2f%2fwww.lexis.com%2fresearch%2fretrieve%3f_m%3dd8ca55f1090c4475c89026e5fbc07401%26docnum%3d4%26_fmtstr%3dFULL%26_startdoc%3d1%26wchp%3ddGLbVzz-zSkAz%26_md5%3de4dd13f6ce45966fc41fc00c665ad0c1&amp;bof=0&amp;clientId=ACME-ACME2-C1235</p>
<p>is the problem of Linux OS</p>
<p>Please advise me where is I am wrong</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yogesh Mathur</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-32627</link>
		<dc:creator>Yogesh Mathur</dc:creator>
		<pubDate>Thu, 26 Nov 2009 07:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-32627</guid>
		<description>That&#039;s what I was looking for, Thanks a lot man.</description>
		<content:encoded><![CDATA[<p>That&#8217;s what I was looking for, Thanks a lot man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-32465</link>
		<dc:creator>Rohit</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-32465</guid>
		<description>Thanks to all, on the net, i was able to get the redirect working, with some help.. code below

I added this to the top of the code, now space or no space it works good.

$mob = str_replace(&quot;+&quot;, &quot;_&quot;, $_SERVER[&#039;QUERY_STRING&#039;]);
$url = &quot;http://example.com/pfinder?&quot; . &quot;$mob&quot;;


and at the end i added this to go to the page i want
$fin = get_final_url($url);
$mov = parse_url($fin, PHP_URL_QUERY);
sleep(5);
header(&quot;Location: http://enample1.com?$mov&quot;);

works fine..
But now i have a problem, the server i was to put this on does not support PHP. (server side)
I know this is not the right forum, but can any one help me to get this done in javascript (client side)</description>
		<content:encoded><![CDATA[<p>Thanks to all, on the net, i was able to get the redirect working, with some help.. code below</p>
<p>I added this to the top of the code, now space or no space it works good.</p>
<p>$mob = str_replace(&#8220;+&#8221;, &#8220;_&#8221;, $_SERVER['QUERY_STRING']);<br />
$url = &#8220;http://example.com/pfinder?&#8221; . &#8220;$mob&#8221;;</p>
<p>and at the end i added this to go to the page i want<br />
$fin = get_final_url($url);<br />
$mov = parse_url($fin, PHP_URL_QUERY);<br />
sleep(5);<br />
header(&#8220;Location: <a href="http://enample1.com?$mov" rel="nofollow">http://enample1.com?$mov</a>&#8220;);</p>
<p>works fine..<br />
But now i have a problem, the server i was to put this on does not support PHP. (server side)<br />
I know this is not the right forum, but can any one help me to get this done in javascript (client side)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-31655</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Mon, 05 Oct 2009 11:52:28 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-31655</guid>
		<description>Thanks for your work. I recently faced a similar problem and your solution made my day lots of easier.

Thomas</description>
		<content:encoded><![CDATA[<p>Thanks for your work. I recently faced a similar problem and your solution made my day lots of easier.</p>
<p>Thomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web design tutorials</title>
		<link>http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/comment-page-1/#comment-31161</link>
		<dc:creator>Web design tutorials</dc:creator>
		<pubDate>Fri, 14 Aug 2009 13:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://w-shadow.com/?p=204#comment-31161</guid>
		<description>very nice script - thanks for sharing!</description>
		<content:encoded><![CDATA[<p>very nice script &#8211; thanks for sharing!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
