<?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>Web development blog &#187; Coding web page</title>
	<atom:link href="http://simplemediacode.info/category/coding-web-page/feed/" rel="self" type="application/rss+xml" />
	<link>http://simplemediacode.info</link>
	<description>by Simple Media Code</description>
	<lastBuildDate>Wed, 09 May 2012 12:19:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Cache expiration on static images and content with .htaccess</title>
		<link>http://simplemediacode.info/cache-expiration-on-static-images-and-content-with-htaccess/</link>
		<comments>http://simplemediacode.info/cache-expiration-on-static-images-and-content-with-htaccess/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 20:07:11 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Cache expiration]]></category>
		<category><![CDATA[content cache]]></category>
		<category><![CDATA[ME2J.COM]]></category>
		<category><![CDATA[selfhosted CDN server]]></category>
		<category><![CDATA[web page optimization]]></category>
		<category><![CDATA[webpage speedup]]></category>
		<category><![CDATA[Websites optimization]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=389</guid>
		<description><![CDATA[You can tray this example,which I am using on my content delivery network (CDN) server ME2J.com....]]></description>
			<content:encoded><![CDATA[<p>One of main thing for all web sites is content caching to improve site performance. Here are few examples how You can achieve this. Set this cache expiration example, which I am using on my <em>content delivery network</em> (CDN) server ME2J.com.</p>
<pre class="brush: bash; title: ; notranslate">
&lt;FilesMatch &quot;.(jpg|png|gif)$&quot;&gt;
ExpiresDefault A0
Header set Cache-Control &quot;max-age=0,  no-cache, must-revalidate&quot;
&lt;/FilesMatch&gt;
</pre>
<p>Which mean, that expiration date is in access moment and set headers to 0 values. As You can see, here You can add more filetypes for static content</p>
<p style="text-align: center"><img class="aligncenter size-full wp-image-401" style="border: 0pt none" src="http://simplemediacode.info/imagesphotos/htaccess-cache-expiration-code-620x360.jpg" alt=".htaccess cache expiration code" width="620" height="360" /></p>
<p>This example can also speed-up Your webpage just with few lines of code by setting longer expiration time:</p>
<pre class="brush: bash; title: ; notranslate">
ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
</pre>
<p>Where A is access time and 2592000=60*60*24*30 or one month.</p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/cache-expiration-on-static-images-and-content-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mini-optimization of statistics / analytics counters on your web page</title>
		<link>http://simplemediacode.info/mini-optimization-of-statistics-analytics-counters-on-your-web-page/</link>
		<comments>http://simplemediacode.info/mini-optimization-of-statistics-analytics-counters-on-your-web-page/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 13:34:20 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[analytics code]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Quantcast]]></category>
		<category><![CDATA[StatCounter.com]]></category>
		<category><![CDATA[web page optimization]]></category>
		<category><![CDATA[Websites optimization]]></category>
		<category><![CDATA[yandex]]></category>
		<category><![CDATA[Yandex Metrika]]></category>
		<category><![CDATA[yandex.ru]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=287</guid>
		<description><![CDATA[Today working on site optimization, made small javascript optimization for several counters on website. Problem: You are using 2-4 statistic counters on Your page. Most of them are using javascript and for noscript mode image (GIF). Solution: Split them and ...]]></description>
			<content:encoded><![CDATA[<p>Today working on site optimization, made small javascript optimization for several counters on website.</p>
<p><strong>Problem</strong>: You are using 2-4 statistic counters on Your page. Most of them are using <em>javascript</em> and for <em><span style="text-decoration: underline;">noscript</span> mode</em> image (GIF).</p>
<p><strong>Solution</strong>: Split them and then merge <img src='http://simplemediacode.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Micro optimization for analytics counters</h2>
<p>Most of codes on my site were with one <span style="text-decoration: underline;">inline</span> javascript code, code from counter&#8217;s site and <em>noscript</em> solution.</p>
<h3>Spliting inline javascript counter code</h3>
<p>First You need to examine all statistics codes, because some have some id before included javascript (like <em>Google Analytics</em>, <em>StatCounter.com</em> or <em>Quantcast</em>) and some after (<em>Yandex</em>). So what we need is take all inline javascripts and put them inside <strong><em>&lt;script&gt;</em></strong> tags, them links put all external janasvripts and then again inline javascript for counters, which use inline script after external javascript.</p>
<p>Here is mine for <a title="Web development, WordPress blog customization, PSD to HTML" href="http://simplemediacode.com">SimpleMediaCode.com</a>:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-799" title="optimize javasacript counters" src="http://simplemediacode.info/files/2010/09/optimize-javasacript-counters.png" alt="optimize javasacript counters" width="590" height="230" /></p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/mini-optimization-of-statistics-analytics-counters-on-your-web-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress theme feature vs. WordPress plugin. What is best?</title>
		<link>http://simplemediacode.info/wordpress-theme-feature-vs-wordpress-plugin-what-is-best-choice/</link>
		<comments>http://simplemediacode.info/wordpress-theme-feature-vs-wordpress-plugin-what-is-best-choice/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 12:20:43 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[Social network applications and plugins]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>
		<category><![CDATA[WordPress widget]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=197</guid>
		<description><![CDATA[As WordPress developer I came to point where I have to decide: make some functions as WordPress theme features or make them more optional and theme independent as WordPress plugins. Both options have pros and cons....]]></description>
			<content:encoded><![CDATA[<p>As WordPress developer at SimpleMediaCode.com I came to point where I have to decide: <strong>make some functions as WordPress theme features</strong> or <strong>make them more optional and theme independent as <a title="custom WordPress plugin development" href="http://simplemediacode.com/wordpress/" target="_blank">WordPress plugins</a></strong>.</p>
<h2>WordPress plugin coding</h2>
<p>If I create plugin for WordPress theme, I am hardening that, so that this function will make sure, that futures are theme independent, if for some reason someone would like to change WordPress theme. In this case, if function is displaying content for private reading (for membership pages), it will still available in other themes as well.</p>
<p><strong>Pluses by developing WordPress plugin:</strong></p>
<ul>
<li>WordPress theme theme independent,</li>
<li>cross theme usage,</li>
<li>more freedom to turn on and off.</li>
</ul>
<p><strong>Minus(es):</strong></p>
<ul>
<li>harder to implement in theme</li>
</ul>
<h2>WordPress theme feature coding</h2>
<p>But if You are using only one theme for site (custom design for site), I&#8217;m sure You can make functions as features for WordPress theme. This is good for specific placement of information, like sidebars or footer information.</p>
<p><strong>WP theme feature pluses:</strong></p>
<ul>
<li>good support of WordPress theme  hacks and hooks,</li>
<li>compatible with WordPress theme.</li>
</ul>
<p><strong>Minus(es):</strong></p>
<ul>
<li>sometimes theme administrations panel can come with too much options</li>
</ul>
<p>So, before creating WordPress theme options page, think about plugin replacements!</p>
<p>There are many more pros and cons&#8230; <span style="text-decoration: underline">What&#8217;s Yours?</span></p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/wordpress-theme-feature-vs-wordpress-plugin-what-is-best-choice/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Removing WWW from URI (or domain) with PHP</title>
		<link>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/</link>
		<comments>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 13:40:13 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[non-www site]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[www prefix]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=136</guid>
		<description><![CDATA[Few weeks ago I wrote how to remove WWW from domain with .htaccess. In some cases or hosting plans it's not possible to view or use .htaccess file (e.g. some low cost or free hosting providers). Solution is PHP code which redirects all www requests to non www page....]]></description>
			<content:encoded><![CDATA[<p>Few weeks ago I wrote <strong><a title="how to remove WWW from domain with .htaccess" href="http://mediabox.lv/en/remove-www-from-domain-with-htaccess/">how to remove WWW from domain with .htaccess</a></strong>. In some cases or hosting plans it&#8217;s not possible to view or use .htaccess file (e.g. some low cost or free hosting providers).</p>
<p><strong>Solution is PHP code</strong> which redirects all www requests to non www page. Since You are (should) use some general configuration or header file in Your web application, you can include this PHP code (very top of php page):</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php // Removing WWW from URI with PHP http://simplemediacode.info/?p=136
if ('mediabox.lv' !== $_SERVER['HTTP_HOST']) {
header('Location: http://mediabox.lv' . $_SERVER['REQUEST_URI'], null, 301);
}
?&gt;
</pre>
<p>It use build-in <a href="http://php.net/manual/en/function.header.php">PHP header() function</a> to redirect all requests to another page, in this case: non-www domain.</p>
<p>Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/removing-www-from-uri-or-domain-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove WWW from domain with .htaccess</title>
		<link>http://simplemediacode.info/remove-www-from-domain-with-htaccess/</link>
		<comments>http://simplemediacode.info/remove-www-from-domain-with-htaccess/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 15:47:26 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[non-www site]]></category>
		<category><![CDATA[www prefix]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=103</guid>
		<description><![CDATA[Another good thing about removing double content is to remove or add www prefix to your domain. Remove WWW from domain This is what I now use for all my domains &#8211; domain without www prefix. Add WWW to domain ...]]></description>
			<content:encoded><![CDATA[<p>Another good thing about removing double content is to remove or add <strong>www </strong>prefix to your domain.</p>
<h2>Remove WWW from domain</h2>
<pre class="brush: bash; title: ; notranslate">
# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^www.mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://mediabox.lv/$1 [R=301,L]
</pre>
<p>This is what I now use for all my domains &#8211; <strong>domain without www prefix</strong>.</p>
<h2>Add WWW to domain</h2>
<p>This probably is best for old domains like mine www.rolandinsh.lv</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove www from your domain
RewriteCond %{HTTP_HOST} ^mediabox.lv$ [NC]
RewriteRule ^(.*)$ http://www.mediabox.lv/$1 [R=301,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/remove-www-from-domain-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to add Google Buzz button to WordPress and Blogger</title>
		<link>http://simplemediacode.info/how-to-add-google-buzz-button-to-wordpress-and-blogger/</link>
		<comments>http://simplemediacode.info/how-to-add-google-buzz-button-to-wordpress-and-blogger/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:49:34 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[Blogger addons]]></category>
		<category><![CDATA[blogspot.com tip]]></category>
		<category><![CDATA[Google Buzz]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=30</guid>
		<description><![CDATA[Already some days are working Google Buzz. I made short search on Google for possibility to add Google Buzz button to Blogger template. As I didn't find it on first page, I decide to rewrite some of previous Blogspot template code, which I made earlier. And for WordPress blogs too......]]></description>
			<content:encoded><![CDATA[<p>Already some days are working Google Buzz. I made short search on Google for possibility to add Google Buzz button to Blogger template. As I didn&#8217;t find it on first page, I decide to rewrite some of previous Blogspot template code, which I made earlier.</p>
<p><img class="aligncenter size-full wp-image-804" title="google buzz logo" src="http://simplemediacode.info/files/2010/02/google-buzz-logo.png" alt="google buzz logo" width="286" height="68" /></p>
<p style="text-align: center;">
<p>So here it is: (live example: <a title="add Google Buzz button to Blogger template" href="http://mediabox4b.blogspot.com/2010/02/google-buzz-button-in-blogspot-blogger.html">http://mediabox4b.blogspot.com</a>)</p>
<pre class="brush: xml; title: ; notranslate">&lt;a expr:href='&amp;&quot;http://www.google.com/reader/link?url=&amp;quot; + data:post.url + &amp;quot;&amp;amp;title=&amp;&quot; + data:post.title + &amp;quot;&amp;amp;srcTitle=&amp;quot; + data:blog.title+ &amp;quot;&amp;amp;srcURL=&amp;quot; + data:blog.homepageUrl ' rel='nofollow' target='_blank'&gt;+add to Google Buzz&lt;/a&gt;</pre>
<p>put it near data:post.body</p>
<blockquote><p>Made with <a title="Web development, WordPress  freelancer, Blogger templates" href="http://mediabox.lv">MediaBox.lv</a> / <a title="Rolands Umbrovskis" href="http://umbrovskis.com/">Umbrovskis.com</a></p></blockquote>
<p>Where<br />
<strong>url=data:post.url</strong> – post URI,<br />
<strong>title=data:post.title</strong> – post title,<br />
<strong>srcTitle=data:blog.title</strong> – post source, You may also use data:blog.homepageUrl,<br />
<strong>srcURL=data:blog.homepageUrl</strong> – source home page.</p>
<p>And Google Buzz button for WordPress blogs:</p>
<pre class="brush: php; title: ; notranslate">
&lt;a href=&quot;http://www.google.com/reader/link?url=&lt;?php the_permalink() ?&gt;&amp;title=&lt;?php the_title(); ?&gt;&amp;srcTitle=&lt;?php bloginfo('url'); ?&gt;&amp;srcURL=&lt;?php bloginfo('url'); ?&gt;&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;+add to Google Buzz&lt;/a&gt;
</pre>
<p>Put this <span style="text-decoration: underline;">inside</span> <strong>WordPress post loop</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/how-to-add-google-buzz-button-to-wordpress-and-blogger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove index.html and/or index.php from the URL</title>
		<link>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/</link>
		<comments>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:56:40 +0000</pubDate>
		<dc:creator>umbrovskis</dc:creator>
				<category><![CDATA[Coding web page]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[duplicate content]]></category>
		<category><![CDATA[RegEx]]></category>
		<category><![CDATA[RegExp]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress MU]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://simplemediacode.info/?p=8</guid>
		<description><![CDATA[Inspired by my discussion with Kaspars on his homepage konstruktors.com  how to better remove index file. So I'll post both versions, because they use different methods: with and with out RewriteEngine On....]]></description>
			<content:encoded><![CDATA[<p>Inspired by my discussion with Kaspars on his homepage <a title="Konstruktors" href="http://konstruktors.com/blog/web-design/2036-remove-index-html-from-the-url/">konstruktors.com</a> how to better <strong>remove index file</strong>. So I&#8217;ll post both versions, because they use different methods: <span style="text-decoration: underline">with</span> and <span style="text-decoration: underline">with out</span> <strong>RewriteEngine On</strong>.</p>
<p>Here is mine with <strong>RewriteEngine On</strong> (works on this hosting and both versions of GoDaddy hosting plans <em>example1.com</em> and <em>example1.com</em>/<em>example2.com</em>):</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove index.html AND index.php from URL
RewriteCond %{THE_REQUEST} /index.(php|html) HTTP [NC]
RewriteRule (.*)index.(php|html)$ /$1 [R=301,L]
</pre>
<p>And Kaspar&#8217;s method without <strong>RewriteEngine On</strong>:</p>
<pre class="brush: bash; title: ; notranslate">
RewriteEngine On # remove this, if you have it already
RewriteCond %{REQUEST_URI} index.html
RewriteRule ^(.*)index.html$ /$1/ [R=301,L]
</pre>
<p>Purpose of this is to remove <strong>duplicate content</strong> from Internet.</p>
<p>[<strong>Update</strong> on 2010.03.30]</p>
<p>Please keep in mind that some <strong>web applications</strong> still need <strong>index.php</strong> file for <span style="text-decoration: underline">installation scripts</span> as referrers. So it&#8217;s good to keep it in mind and comment these line during installation process if it fails.</p>
<pre class="brush: bash; title: ; notranslate">
# This will remove index.html AND index.php from URL
# RewriteCond %{THE_REQUEST} /index.(php|html) HTTP [NC]
# RewriteRule (.*)index.(php|html)$ /$1 [R=301,L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://simplemediacode.info/remove-index-html-andor-index-php-from-the-url/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

