<?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>IT Guys blog &#187; Code Scripts</title>
	<atom:link href="http://www.it-etc.com/category/coding-scripts-tips-and-shortcuts/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.it-etc.com</link>
	<description>Information Technology Tips &#038; Tricks</description>
	<lastBuildDate>Fri, 06 Jan 2012 13:52:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to redirect traffic to another domain  aka 301 redirect</title>
		<link>http://www.it-etc.com/2008/06/05/how-to-redirect-traffic-to-another-domain-aka-301-redirect/</link>
		<comments>http://www.it-etc.com/2008/06/05/how-to-redirect-traffic-to-another-domain-aka-301-redirect/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 00:25:24 +0000</pubDate>
		<dc:creator>itahmed</dc:creator>
				<category><![CDATA[ALL]]></category>
		<category><![CDATA[Code Scripts]]></category>
		<category><![CDATA[Computer HowTo]]></category>

		<guid isPermaLink="false">http://www.it-etc.com/2008/06/05/how-to-redirect-traffic-to-another-domain-aka-301-redirect/</guid>
		<description><![CDATA[301 Redirect 301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code &#8220;301&#8243; is interpreted as [...]]]></description>
			<content:encoded><![CDATA[<h2>301 Redirect</h2>
<p align="justify" class="defaultfont">301 redirect is the most efficient and <strong>Search Engine Friendly</strong> method for webpage redirection. It&#8217;s not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it&#8217;s the safest option. The code &#8220;301&#8243; is interpreted as &#8220;moved permanently&#8221;.</p>
<p align="justify" class="defaultfont">You can Test your redirection with <a href="http://www.webconfs.com/redirect-check.php"><strong>Search Engine Friendly Redirect Checker</strong></a></p>
<p align="justify" class="defaultfont">Below are a Couple of methods to implement <strong>URL Redirection</strong></p>
<h2>IIS Redirect</h2>
<ul class="defaultfont">
<li>In internet services manager, right click on the file or folder you wish to redirect</li>
<li>Select the radio titled &#8220;a redirection to a URL&#8221;.</li>
<li>Enter the redirection page</li>
<li>Check &#8220;The exact url entered above&#8221; and the &#8220;A permanent redirection for this resource&#8221;</li>
<li>Click on &#8216;Apply&#8217;</li>
</ul>
<h2>ColdFusion Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">&lt;.cfheader statuscode=&#8221;301&#8243; statustext=&#8221;Moved permanently&#8221;&gt;<br />
&lt;.cfheader name=&#8221;Location&#8221; value=&#8221;http://www.new-url.com&#8221;&gt; </font></font></p>
<h2>PHP Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">&lt;?<br />
Header( &#8220;HTTP/1.1 301 Moved Permanently&#8221; );<br />
Header( &#8220;Location: http://www.new-url.com&#8221; );<br />
?&gt; </font></font></p>
<h2>ASP Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">&lt;%@ Language=VBScript %&gt;<br />
&lt;%<br />
Response.Status=&#8221;301 Moved Permanently&#8221;<br />
Response.AddHeader &#8220;Location&#8221;,&#8221;http://www.new-url.com/&#8221;<br />
%&gt; </font></font></p>
<h2>ASP .NET Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">&lt;script runat=&#8221;server&#8221;&gt;<br />
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
Response.Status = &#8220;301 Moved Permanently&#8221;;<br />
Response.AddHeader(&#8220;Location&#8221;,&#8221;http://www.new-url.com&#8221;);<br />
}<br />
&lt;/script&gt; </font></font></p>
<h2>JSP (Java) Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">&lt;%<br />
response.setStatus(301);<br />
response.setHeader( &#8220;Location&#8221;, &#8220;http://www.new-url.com/&#8221; );<br />
response.setHeader( &#8220;Connection&#8221;, &#8220;close&#8221; );<br />
%&gt; </font></font></p>
<h2>CGI PERL Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">$q = new CGI;<br />
print $q-&gt;redirect(&#8220;http://www.new-url.com/&#8221;); </font></font></p>
<h2>Ruby on Rails Redirect</h2>
<p><font face="Verdana"><font class="defaultfont">def old_action<br />
headers["Status"] = &#8220;301 Moved Permanently&#8221;<br />
redirect_to &#8220;http://www.new-url.com/&#8221;<br />
end </font></font></p>
<h2>Redirect Old domain to New domain (htaccess redirect)</h2>
<p align="justify" class="defaultfont">Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.<br />
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)</p>
<p align="justify" class="defaultfont">Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]</p>
<p align="justify" class="defaultfont">Please REPLACE www.newdomain.com in the above code with your actual domain name.</p>
<p align="justify" class="defaultfont">In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.</p>
<p align="justify" class="defaultfont"><strong>Note*</strong> This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.</p>
<h2>Redirect to www (htaccess redirect)</h2>
<p align="justify" class="defaultfont">Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com<br />
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)</p>
<p align="justify" class="defaultfont">Options +FollowSymlinks<br />
RewriteEngine on<br />
rewritecond %{http_host} ^domain.com [nc]<br />
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]</p>
<p align="justify" class="defaultfont">Please REPLACE domain.com and www.newdomain.com with your actual domain name.</p>
<p align="justify" class="defaultfont"><strong>Note*</strong> This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.</p>
<h2>How to Redirect HTML</h2>
<p align="justify" class="defaultfont">Please refer to section titled &#8216;How to Redirect with htaccess&#8217;, if your site is hosted on a Linux Server and &#8216;IIS Redirect&#8217;, if your site is hosted on a Windows Server.</p>
<p align="justify" class="defaultfont">There is a good resource site that talks into similar details about domain forwarding, search engine friendly methods and so forth. check it out</p>
<p align="justify" class="defaultfont"><a target="_blank" href="http://www.webconfs.com" title="Website tools and tips">http://www.webconfs.com</a> </p>
<p align="justify" class="defaultfont">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-etc.com/2008/06/05/how-to-redirect-traffic-to-another-domain-aka-301-redirect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP error 5.2.4 Getting error &#8220;Error in my_thread_global_end(): 1 threads didn&#8217;t exit&#8221;</title>
		<link>http://www.it-etc.com/2007/10/25/php-error-524-getting-error-error-in-my_thread_global_end-1-threads-didnt-exit/</link>
		<comments>http://www.it-etc.com/2007/10/25/php-error-524-getting-error-error-in-my_thread_global_end-1-threads-didnt-exit/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 06:17:27 +0000</pubDate>
		<dc:creator>itahmed</dc:creator>
				<category><![CDATA[ALL]]></category>
		<category><![CDATA[Code Scripts]]></category>
		<category><![CDATA[Computer HowTo]]></category>

		<guid isPermaLink="false">http://www.it-etc.com/2007/10/25/php-error-524-getting-error-error-in-my_thread_global_end-1-threads-didnt-exit/</guid>
		<description><![CDATA[We have noticed a few web server admins to be getting an error message Getting error &#8220;Error in my_thread_global_end(): 1 threads didn&#8217;t exit&#8221; when running php on IIS windows servers in CGI. the issue is caused by libmysql.dll found in php directory. The file size for the libmysql.dll was 1.94 MB (2,035,712 bytes). To fix [...]]]></description>
			<content:encoded><![CDATA[<p>We have noticed a few web server admins to be getting an error message Getting error &#8220;Error in my_thread_global_end(): 1 threads didn&#8217;t exit&#8221; when running php on IIS windows servers in CGI. the issue is caused by libmysql.dll found in php directory. The file size for the libmysql.dll was 1.94 MB (2,035,712 bytes).</p>
<p>To fix the issue and clear the error message, you must replace libmysql.dll with an earlier version from release 5.2.1 of PHP.</p>
<p>I noticed many people were not able to get their hands on it so we have uploaded it to our server to make it easily availble.<br />
<a href="http://www.it-etc.com/wp-content/uploads/2007/10/php_520_libmysqldll_win32.zip" title="Download php mysql libmysql.dll">Download php mysql libmysql.dll</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.it-etc.com/2007/10/25/php-error-524-getting-error-error-in-my_thread_global_end-1-threads-didnt-exit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DOS IF command to check file if exist</title>
		<link>http://www.it-etc.com/2007/08/10/dos-if-command-to-check-file-if-exist/</link>
		<comments>http://www.it-etc.com/2007/08/10/dos-if-command-to-check-file-if-exist/#comments</comments>
		<pubDate>Fri, 10 Aug 2007 05:46:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ALL]]></category>
		<category><![CDATA[Code Scripts]]></category>
		<category><![CDATA[Computer HowTo]]></category>

		<guid isPermaLink="false">http://www.it-etc.com/?p=4</guid>
		<description><![CDATA[Simple opertations can seem easy but in some instances it is challenging. Many network administrators can find this useful when deploying new files to the company computer using batch files. Here is some good info on how to use the if statement. Performs conditional processing in batch programs. IF [NOT] ERRORLEVEL number command IF [NOT] [...]]]></description>
			<content:encoded><![CDATA[<p>Simple opertations can seem easy but in some instances it is challenging.</p>
<p>Many network administrators can find this useful when deploying new files to the company computer using batch files.</p>
<p>Here is some good info on how to use the if statement.</p>
<blockquote><p>Performs conditional processing in batch programs.</p>
<p>IF [NOT] ERRORLEVEL number command<br />
IF [NOT] string1==string2 command<br />
IF [NOT] EXIST filename command</p>
<p>  NOT               Specifies that Windows XP should carry out<br />
                    the command only if the condition is false.</p>
<p>  ERRORLEVEL number Specifies a true condition if the last program run<br />
                    returned an exit code equal to or greater than the number<br />
                    specified.</p>
<p>  string1==string2  Specifies a true condition if the specified text strings<br />
                    match.</p>
<p>  EXIST filename    Specifies a true condition if the specified filename<br />
                    exists.</p>
<p>  command           Specifies the command to carry out if the condition is<br />
                    met.  Command can be followed by ELSE command which<br />
                    will execute the command after the ELSE keyword if the<br />
                    specified condition is FALSE</p>
<p>The ELSE clause must occur on the same line as the command after the IF.  For<br />
example:</p>
<p>    IF EXIST filename. (<br />
        del filename.<br />
    ) ELSE (<br />
        echo filename. missing.<br />
    )</p>
<p>The following would NOT work because the del command needs to be terminated<br />
by a newline:</p>
<p>    IF EXIST filename. del filename. ELSE echo filename. missing</p>
<p>Nor would the following work, since the ELSE command must be on the same line<br />
as the end of the IF command:</p>
<p>    IF EXIST filename. del filename.<br />
    ELSE echo filename. missing</p>
<p>The following would work if you want it all on one line:</p>
<p>    IF EXIST filename. (del filename.) ELSE echo filename. missing</p>
<p>If Command Extensions are enabled IF changes as follows:</p>
<p>    IF [/I] string1 compare-op string2 command<br />
    IF CMDEXTVERSION number command<br />
    IF DEFINED variable command</p>
<p>where compare-op may be one of:</p>
<p>    EQU &#8211; equal<br />
    NEQ &#8211; not equal<br />
    LSS &#8211; less than<br />
    LEQ &#8211; less than or equal<br />
    GTR &#8211; greater than<br />
    GEQ &#8211; greater than or equal</p>
<p>and the /I switch, if specified, says to do case insensitive string<br />
compares.  The /I switch can also be used on the string1==string2 form<br />
of IF.  These comparisons are generic, in that if both string1 and<br />
string2 are both comprised of all numeric digits, then the strings are<br />
converted to numbers and a numeric comparison is performed.</p>
<p>The CMDEXTVERSION conditional works just like ERRORLEVEL, except it is<br />
comparing against an internal version number associated with the Command<br />
Extensions.  The first version is 1.  It will be incremented by one when<br />
significant enhancements are added to the Command Extensions.<br />
CMDEXTVERSION conditional is never true when Command Extensions are<br />
disabled.</p>
<p>The DEFINED conditional works just like EXISTS except it takes an<br />
environment variable name and returns true if the environment variable<br />
is defined.</p>
<p>%ERRORLEVEL% will expand into a string representation of<br />
the current value of ERRORLEVEL, provided that there is not already<br />
an environment variable with the name ERRORLEVEL, in which case you<br />
will get its value instead.  After running a program, the following<br />
illustrates ERRORLEVEL use:</p>
<p>    goto answer%ERRORLEVEL%<br />
    :answer0<br />
    echo Program had return code 0<br />
    :answer1<br />
    echo Program had return code 1</p>
<p>You can also using the numerical comparisons above:</p>
<p>    IF %ERRORLEVEL% LEQ 1 goto okay</p>
<p>%CMDCMDLINE% will expand into the original command line passed to<br />
CMD.EXE prior to any processing by CMD.EXE, provided that there is not<br />
already an environment variable with the name CMDCMDLINE, in which case<br />
you will get its value instead.</p>
<p>%CMDEXTVERSION% will expand into a string representation of the<br />
current value of CMDEXTVERSION, provided that there is not already<br />
an environment variable with the name CMDEXTVERSION, in which case you<br />
will get its value instead.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.it-etc.com/2007/08/10/dos-if-command-to-check-file-if-exist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

