<?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: Friendly error pages using PHP and .htaccess</title>
	<atom:link href="http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/</link>
	<description></description>
	<lastBuildDate>Wed, 01 Sep 2010 23:07:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Lee Stewart</title>
		<link>http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/comment-page-1/#comment-8736</link>
		<dc:creator>Lee Stewart</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/#comment-8736</guid>
		<description>I wasted all that time making error pages and could have used these?

Although, I have my website eMailing me with the errors, so I think I&#039;m a bigger geek than you guys...</description>
		<content:encoded><![CDATA[<p>I wasted all that time making error pages and could have used these?</p>
<p>Although, I have my website eMailing me with the errors, so I think I&#039;m a bigger geek than you guys&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amy</title>
		<link>http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/comment-page-1/#comment-8735</link>
		<dc:creator>Amy</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/#comment-8735</guid>
		<description>Hmmmmm.  Yes.  I can tell you how to do it in my language of choice (PHP) &lt;i&gt;(everybody quit laughing already!)&lt;/i&gt; .  It&#039;s an UGLY solution, but sometimes ugly problems require...well, you know.

You can repeat the elseif{} section as many times as necessary depending on how many sites you have.

I &lt;i&gt;think&lt;/i&gt; &#036;_SERVER[&#039;REDIRECT_URL&#039;] is the right PHP variable to use, but I&#039;m bashing this out in a hurry.  Expect syntax errors and the like, but I think this is at least a start for a solution.

Anyway, here &#039;tis.

&lt;h3&gt;&lt;?
if(stristr(&#036;_SERVER[&#039;REDIRECT_URL&#039;],&quot;main_name_of_first_site&quot;))  { ?&gt;

	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
	&lt;html&gt;
	&lt;head&gt;
	&lt;title&gt;404 - File not found.&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;
	&lt;p&gt;That file (&lt;strong&gt;http://example.com&lt;?= &#036;_SERVER[&#039;REQUEST_URI&#039;] ?&gt;&lt;/strong&gt;) does not exist.  Other nicely apologetic language can go here.&lt;/p&gt;
	&lt;/body&gt;
	&lt;/html&gt;
	&lt;? }
elseif(stristr(&#036;_SERVER[&#039;REDIRECT_URL&#039;],&quot;main_name_of_second_site&quot;))  { ?&gt;
	
	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
	&lt;html&gt;
	&lt;head&gt;
	&lt;title&gt;404 - File not found.&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;
	&lt;p&gt;That file (&lt;strong&gt;http://example2.com&lt;?= &#036;_SERVER[&#039;REQUEST_URI&#039;] ?&gt;&lt;/strong&gt;) does not exist. Other nicely apologetic language can go here.&lt;/p&gt;
	&lt;/body&gt;
	&lt;/html&gt;
	&lt;? }

	
else { ?&gt;
	
	&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;
	&lt;html&gt;
	&lt;head&gt;
	&lt;title&gt;404 - File not found.&lt;/title&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;
	&lt;p&gt;That file (&lt;strong&gt;http://example3.com&lt;?= &#036;_SERVER[&#039;REQUEST_URI&#039;] ?&gt;&lt;/strong&gt;) does not exist. Other nicely apologetic language can go here.&lt;/p&gt;
	&lt;/body&gt;
	&lt;/html&gt;
&lt;? } ?&gt; &lt;/h3&gt;</description>
		<content:encoded><![CDATA[<p>Hmmmmm.  Yes.  I can tell you how to do it in my language of choice (PHP) <i>(everybody quit laughing already!)</i> .  It&#039;s an UGLY solution, but sometimes ugly problems require&#8230;well, you know.</p>
<p>You can repeat the elseif{} section as many times as necessary depending on how many sites you have.</p>
<p>I <i>think</i> &#36;_SERVER['REDIRECT_URL'] is the right PHP variable to use, but I&#039;m bashing this out in a hurry.  Expect syntax errors and the like, but I think this is at least a start for a solution.</p>
<p>Anyway, here &#039;tis.</p>
<h3>&lt;?<br />
if(stristr(&#36;_SERVER['REDIRECT_URL'],&#034;main_name_of_first_site&#034;))  { ?&gt;</p>
<p>	&lt;!DOCTYPE HTML PUBLIC &#034;-//W3C//DTD HTML 4.0 Transitional//EN&#034;&gt;<br />
	&lt;html&gt;<br />
	&lt;head&gt;<br />
	&lt;title&gt;404 &#8211; File not found.&lt;/title&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;<br />
	&lt;p&gt;That file (&lt;strong&gt;http://example.com&lt;?= &#36;_SERVER['REQUEST_URI'] ?&gt;&lt;/strong&gt;) does not exist.  Other nicely apologetic language can go here.&lt;/p&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
	&lt;? }<br />
elseif(stristr(&#36;_SERVER['REDIRECT_URL'],&#034;main_name_of_second_site&#034;))  { ?&gt;</p>
<p>	&lt;!DOCTYPE HTML PUBLIC &#034;-//W3C//DTD HTML 4.0 Transitional//EN&#034;&gt;<br />
	&lt;html&gt;<br />
	&lt;head&gt;<br />
	&lt;title&gt;404 &#8211; File not found.&lt;/title&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;<br />
	&lt;p&gt;That file (&lt;strong&gt;http://example2.com&lt;?= &#36;_SERVER['REQUEST_URI'] ?&gt;&lt;/strong&gt;) does not exist. Other nicely apologetic language can go here.&lt;/p&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
	&lt;? }</p>
<p>else { ?&gt;</p>
<p>	&lt;!DOCTYPE HTML PUBLIC &#034;-//W3C//DTD HTML 4.0 Transitional//EN&#034;&gt;<br />
	&lt;html&gt;<br />
	&lt;head&gt;<br />
	&lt;title&gt;404 &#8211; File not found.&lt;/title&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
	&lt;h1&gt;404.  File not found.&lt;/h1&gt;<br />
	&lt;p&gt;That file (&lt;strong&gt;http://example3.com&lt;?= &#36;_SERVER['REQUEST_URI'] ?&gt;&lt;/strong&gt;) does not exist. Other nicely apologetic language can go here.&lt;/p&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
&lt;? } ?&gt; </h3>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/comment-page-1/#comment-8734</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scriptygoddess.com/archives/2002/12/08/friendly-error-pages-using-php-and-htaccess/#comment-8734</guid>
		<description>this seams like the right place to ask this: on my host they only let me have one custom 404 (and so on) page, but i am hosting 3 sites, all with totally different looks, i would like to make some php that gets the refering url and check the domain name (cause they all have a different one) and displays certain code, but no clue how to do it, any ideas?</description>
		<content:encoded><![CDATA[<p>this seams like the right place to ask this: on my host they only let me have one custom 404 (and so on) page, but i am hosting 3 sites, all with totally different looks, i would like to make some php that gets the refering url and check the domain name (cause they all have a different one) and displays certain code, but no clue how to do it, any ideas?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.360 seconds -->
