<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#8235;תומר דוד - ללמוד להצליח &#187; דף שגיאה מותאם&#8236;</title>	<atom:link href="http://www.sick.co.il/tag/%d7%93%d7%a3-%d7%a9%d7%92%d7%99%d7%90%d7%94-%d7%9e%d7%95%d7%aa%d7%90%d7%9d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sick.co.il</link>
	<description>&#8235;הכל מהכל וכמה שיותר.&#8236;</description>	<lastBuildDate>Sun, 29 Jan 2012 09:58:27 +0000</lastBuildDate>
	<language>he</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>&#8235;להוציא את המירב מהשגיאה 404&#8236;</title>		<link>http://www.sick.co.il/%d7%9b%d7%9c%d7%9c%d7%99/243/</link>
		<comments>http://www.sick.co.il/%d7%9b%d7%9c%d7%9c%d7%99/243/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 21:17:20 +0000</pubDate>
		<dc:creator>&#8235;תומר דוד&#8236;</dc:creator>				<category><![CDATA[PHP]]></category>
		<category><![CDATA[כללי]]></category>
		<category><![CDATA[ניהול ובניית אתרים]]></category>
		<category><![CDATA[קידום אתרים]]></category>
		<category><![CDATA[404 error]]></category>
		<category><![CDATA[error page]]></category>
		<category><![CDATA[דף שגיאה מותאם]]></category>
		<category><![CDATA[ניצול נכון של דף שגיאה]]></category>
		<category><![CDATA[שגיאה 404]]></category>
		<category><![CDATA[שרת Apache]]></category>

		<guid isPermaLink="false">http://www.sick.co.il/?p=243</guid>
		<description><![CDATA[&#8235;ככל שיש באתר שלך יותר דפים וקישורים כך הסיכוי שאחד מהמבקרים באתר יגיע לדף לא קיים. אם מבקר באתר מנסה<a href="http://www.sick.co.il/%d7%9b%d7%9c%d7%9c%d7%99/243/" class="searchmore">Read the Rest...</a><div class="clr"></div>&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p><a href="http://www.sick.co.il/wp-content/uploads/2010/06/error404.png"><img alt="" class="alignright size-thumbnail wp-image-269" height="150" src="http://www.sick.co.il/wp-content/uploads/2010/06/error404-150x150.png" title="error404" width="150" /></a>ככל שיש באתר שלך יותר דפים וקישורים כך הסיכוי שאחד מהמבקרים באתר יגיע לדף לא קיים. אם מבקר באתר מנסה לגשת לדף שלא קיים באתר, השרת באופן אוטומטי יציג&nbsp;</p>
<div>את השגיאה 404. בברירת המחדת השרת מציג דף לא חברותי עם מידע אודות השגיאה שנותן לרוב המבקרים להפסיק לבקר באתר. אבל אם משתמשים בשגיאה 404 בדרך הנכונה,&nbsp;</div>
<div>אתה בעל האתר יכול לאסוף מידע חשוב כמו:</div>
<div>&nbsp;</div>
<ul>
<li>הקישור או הדף השבור כמובן.</li>
<li>המידע HTTP_REFERER איפה שהלינק השבור אפשרי.</li>
<li>כמה אנשים בד&quot;ב מנסים לגשת לדף השבור.</li>
</ul>
<div>&nbsp;</div>
<div>שמשתמשים בכלים הנכונים אתה יכול להפוך את השגיאה 404 למקור מאוד חשוב:</div>
<div>&nbsp;</div>
<div>
<ul>
<li>לספק אפשרות חיפוש ולתת למבקרים באתר לחפש את מה שהם רוצים.</li>
<li>להוסיף פרסומות לדף השגיאה ולהתחיל להרוויח כסף.</li>
<li>ללמוד על מה אנשים אוהבים לראות באתר שלך.</li>
</ul>
<div>&nbsp;</div>
<div>במדריך הזה אתה תלמד איך:</div>
<div>&nbsp;</div>
<ul>
<li>ליצור דפי שגיאה דינאמים עם החיפוש של גוגל ופרסומות של גוגל אדסנס.</li>
<li>איך לעקוב אחר שגיאות 404 דרך פילטרים בגוגל אנליטיקס.</li>
<li>להשתמש באפשרות חיפוש אתר בגוגל אנליטיקס כדי לאסוף את שאילתות החיפוש מהמבקרים שלך.</li>
</ul>
<div>&nbsp;</div>
<div>
<div><span style="color:#b22222;"><span style="font-size:16px;"><strong>דף שגיאה מותאם</strong></span></span></div>
<div>&nbsp;</div>
<div>בשרת האינטרנט Apache זה אפשרי להשתמש בדפי שגיאה מותאמים. שים את הקוד הבא בקובץ ה- htaccess אם אין לך את הקובץ צור אחד כזה ומקם אותו בתיקיית&nbsp;</div>
<div>השורש (תיקיה ראשית).</div>
<div>&nbsp;</div>
<div style="text-align: left; ">ErrorDocument 400 /error.php?err=400</div>
<div style="text-align: left; ">ErrorDocument 401 /error.php?err=401</div>
<div style="text-align: left; ">ErrorDocument 403 /error.php?err=403</div>
<div style="text-align: left; ">ErrorDocument 404 /error.php?err=404</div>
<div style="text-align: left; ">ErrorDocument 500 /error.php?err=500</div>
<div style="text-align: left; ">&nbsp;</div>
<div>
<div>אנחנו נשתמש בסקריפט השגיאה בשביל רוב שגיאות ה- HTTP.</div>
<div>בשלב הבא צריך ליצור סקריפט ב- PHP שנקרא error.php שיכול לקלוט שגיאות שונות.</div>
<div>&nbsp;</div>
</p></div>
<div style="direction:ltr;text-align:left;">
<div>&lt;?php</div>
<div>$errorNum = (int)$_GET[&#39;err&#39;];</div>
<div>$err_str = array(404=&gt;&#39;Not Found&#39;, 400=&gt;&#39;Bad Request&#39;, 401=&gt;&#39;Unauthorized&#39;, 403=&gt;&#39;Forbidden&#39;, 500=&gt;&#39;Internal Server Error&#39;);</div>
<div>echo &#39;</div>
<div>&lt;html&gt;</div>
<div>&lt;head&gt;</div>
<div>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</div>
<div>&lt;title&gt;&#39;.$err_str[$errorNum].&#39;&lt;/title&gt;</div>
<div>&lt;/head&gt;</div>
<div>&lt;body&gt;</div>
<div>&lt;h1&gt;An error occured: &#39;.$err_str[$errorNum].&#39;&lt;/h1&gt;</div>
<div>&nbsp;</div>
<div>&lt;!&#8211; place here your advertisement &#8211;&gt;</div>
<div>&nbsp;</div>
<div>&lt;!&#8211; place here your Google analytics code &#8211;&gt;</div>
<div>&lt;/body&gt;</div>
<div>&lt;/html&gt;&#39;;</div>
<div>?&gt;</div>
</p></div>
<p>הקוד הבא מראה שגיאות שונות וגם אפשרות להוסיף פרסומות.&nbsp;</p>
<p><span style="color:#b22222;"><span style="font-size:16px;"><strong>עקוב אחרי לינקים שבורים בגוגל אנליטיקס</strong></span></span></p>
<p>במקרה של דף שגיאה 404 הכותרת בדף השגיאה המותאם תהיה &quot;Not Found&quot;. אנחנו נשתמש בכותרת הדף כפילטר בגוגל אנליטיקס כדי לעקוב אחרי מספר הצפיות בדף.</p>
<div>צור פרופיל חדש לאתר שעליו אתה עובד והוסף את הפילטר הבא:</div>
<div>&nbsp;</div>
<div><a href="http://www.sick.co.il/wp-content/uploads/2010/06/Edit-Filter-Google-Analytics1-300x178.png"><img alt="" class="aligncenter size-full wp-image-261" height="178" src="http://www.sick.co.il/wp-content/uploads/2010/06/Edit-Filter-Google-Analytics1-300x178.png" title="Edit-Filter-Google-Analytics1-300x178" width="300" /></a></div>
<div>&nbsp;</div>
<div><span style="color:#b22222;"><span style="font-size:16px;"><strong>הוספת חיפוש גוגל לדף 404 שלך</strong></span></span></div>
<div>&nbsp;</div>
<div>
<div>אם עדיין לא השתמשת בחיפוש של גוגל לאתרים צור חיפוש מותאם של גוגל לאתר שלך.הוסף רק את האתר שלך לרשימת האתרים בחיפוש ולא חיפוש בכל האינטרנט. הוסף את &nbsp;Adsense ID שלך ובחר באפשרות iframe. בחר סגנון לטופס החיפוש / תוצאות, אולי תרצה גם לשנות את הסגנון. לחץ על הכפתור &quot;קבל קוד&quot; והוסף שם את השגיאה. העתק / הדבק את קוד טופס החיפוש והתוצאות והדבק אותו בתוך &quot;&lt;body&gt;&quot; בקובץ השגיאה: error.php שיצרנו לפני כן.</div>
<div>הדף המלא אמור להיראות ככה:</div>
<div style="text-align:left;direction:ltr;">
<div>&nbsp;</div>
<div style="text-align: left; ">
<div>&lt;?php</div>
<div>$errorNum = (int)$_GET[&#39;err&#39;];</div>
<div>$err_str = array(404=&gt;&#39;Not Found&#39;, 400=&gt;&#39;Bad Request&#39;, 401=&gt;&#39;Unauthorized&#39;, 403=&gt;&#39;Forbidden&#39;, 500=&gt;&#39;Internal Server Error&#39;);</div>
<div>echo &#39;</div>
<div>&lt;html&gt;</div>
<div>&lt;head&gt;</div>
<div>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;</div>
<div>&lt;title&gt;&#39;.$err_str[$errorNum].&#39;&lt;/title&gt;</div>
<div>&lt;/head&gt;</div>
<div>&lt;body&gt;</div>
<div>&lt;h1&gt;An error occured: &#39;.$err_str[$errorNum].&#39;&lt;/h1&gt;</div>
<div>&nbsp;</div>
<div>&lt;form action=&quot;http://www.yourdomain.com/error.php&quot; id=&quot;cse-search-box&quot;&gt;</div>
<div>&nbsp;&nbsp;&lt;div&gt;</div>
<div>&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;cx&quot; value=&quot;thisCodeIsProvidedByGoogleCSE&quot; /&gt;</div>
<div>&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;cof&quot; value=&quot;FORID:10&quot; /&gt;</div>
<div>&nbsp;&nbsp; &nbsp;&lt;input type=&quot;hidden&quot; name=&quot;ie&quot; value=&quot;UTF-8&quot; /&gt;</div>
<div>&nbsp;&nbsp; &nbsp;&lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;31&quot; /&gt;</div>
<div>&nbsp;&nbsp; &nbsp;&lt;input type=&quot;submit&quot; name=&quot;sa&quot; value=&quot;Zoeken&quot; /&gt;</div>
<div>&nbsp;&nbsp;&lt;/div&gt;</div>
<div>&lt;/form&gt;</div>
<div>&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en&quot;&gt;&lt;/script&gt;</div>
<div>&nbsp;</div>
<div>&lt;div id=&quot;cse-search-results&quot;&gt;&lt;/div&gt;</div>
<div>&lt;script type=&quot;text/javascript&quot;&gt;</div>
<div>&nbsp;&nbsp;var googleSearchIframeName = &quot;cse-search-results&quot;;</div>
<div>&nbsp;&nbsp;var googleSearchFormName = &quot;cse-search-box&quot;;</div>
<div>&nbsp;&nbsp;var googleSearchFrameWidth = 600;</div>
<div>&nbsp;&nbsp;var googleSearchDomain = &quot;www.google.com&quot;;</div>
<div>&nbsp;&nbsp;var googleSearchPath = &quot;/cse&quot;;</div>
<div>&lt;/script&gt;</div>
<div>&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/afsonline/show_afs_search.js&quot;&gt;&lt;/script&gt;&#39;;</div>
<div>&nbsp;</div>
<div>if (empty($_GET[&#39;q&#39;])) { // show the ad only if there is no search</div>
<div>echo &#39;</div>
<div>&lt;!&#8211; place here your advertisement &#8211;&gt;&#39;;</div>
<div>}&nbsp;</div>
<div>echo &#39;</div>
<div>&lt;!&#8211; place here your Google analytics code &#8211;&gt;</div>
<div>&lt;/body&gt;</div>
<div>&lt;/html&gt;&#39;;</div>
<div>?&gt;</div>
</p></div>
</p></div>
<p>מיקמנו את קוד הפרסומת גם בתוך תנאי IF, בגלל שלא אמור להיות עוד פרסומת Google Adsense חוץ מפרסומת של גוגל בדף התוצאות.</p>
<p><span style="color:#b22222;"><span style="font-size:16px;"><strong>לאפשר בגוגל אנליטיקס לעקוב אחר חיפוש באתר</strong></span></span></p>
<p>הקוד בדף השגיאה שיצרנו מוכן ועכשיו נעבור לשלב האחרון: לעקוב אחר שאילתות החיפוש מדף השגיאה שיצרנו. כדי לעשות את זה צריך להיכנס לפרופיל בגוגל אנליטיקס שיצרנו&nbsp;לדף השגיאה המותאם וללחוץ Edit, לסמן את האפשרות Do Track Site Search, הוסף &quot;q&quot; ב- &quot;Query Parameter&quot; ולחץ Safe Changes.</p>
<div>דף השגיאה הזה מאוד בסיסי וצריך להוסיף אותו לתבנית באתר שלך כדי להשלים אותו.&nbsp;</div>
</p></div>
</p></div>
</div>
</div>]]></content:encoded>			<wfw:commentRss>http://www.sick.co.il/%d7%9b%d7%9c%d7%9c%d7%99/243/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

