<?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>36Flavours.com &#187; SEO</title>
	<atom:link href="http://36flavours.com/category/seo/feed/" rel="self" type="application/rss+xml" />
	<link>http://36flavours.com</link>
	<description>A taste of something different...</description>
	<lastBuildDate>Mon, 19 Apr 2010 20:01:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WP Page Meta Plugin (1,000 downloads)</title>
		<link>http://36flavours.com/2009/11/wp-page-meta-plugin-1000-downloads/</link>
		<comments>http://36flavours.com/2009/11/wp-page-meta-plugin-1000-downloads/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 18:36:59 +0000</pubDate>
		<dc:creator>Steve Whiteley</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[page]]></category>

		<guid isPermaLink="false">http://36flavours.com/?p=556</guid>
		<description><![CDATA[The WordPress Page Meta plugin was initially written as a simple solution for adding meta descriptions to pages on a site I have been working on, as this is not available by default. Today it broke through the 1,000 downloads mark. The plugin quite quickly evolved into a solution that allowed for keywords as well [...]]]></description>
			<content:encoded><![CDATA[<p class="first">The <a href="http://wordpress.org/extend/plugins/pagemeta/" target="_blank">WordPress Page Meta plugin</a> was initially written as a simple solution for adding meta descriptions to pages on a site I have been working on, as this is not available by default. Today it broke through the <a href="http://wordpress.org/extend/plugins/pagemeta/stats/" target="_blank">1,000 downloads</a> mark.</p>
<p>The plugin quite quickly evolved into a solution that allowed for keywords as well as descriptions to be added, as well as the ability to set a custom page title. If required the page title can even be defined in your page template, allowing for dynamic pages /  templates to have specific titles.<span id="more-556"></span></p>
<p>Although unsure if anyone would actually be interested in using it, I decided to publish it to the Plugin Directory anyway. If anything it would allow me to manage the <a href="http://wordpress.org/extend/plugins/pagemeta/changelog/" target="_blank">versions</a> and easily update the handful of blogs that I have installed it on.</p>
<p>I actually thought that my second plugin, <a href="http://wordpress.org/extend/plugins/subheading/" target="_blank">SubHeading</a> would be more popular as there aren&#8217;t many existing solutions in the Directory for this. It&#8217;s not far behind in downloads, with just over <strong>850</strong> to date.</p>
]]></content:encoded>
			<wfw:commentRss>http://36flavours.com/2009/11/wp-page-meta-plugin-1000-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending the WordPress mod_rewrite rules</title>
		<link>http://36flavours.com/2009/10/extending-the-wordpress-mod_rewrite-rules/</link>
		<comments>http://36flavours.com/2009/10/extending-the-wordpress-mod_rewrite-rules/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 17:29:23 +0000</pubDate>
		<dc:creator>Steve Whiteley</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[query_vars]]></category>
		<category><![CDATA[rewrite rule]]></category>

		<guid isPermaLink="false">http://36flavours.com/?p=423</guid>
		<description><![CDATA[If you have written a WordPress Plug-in, or a highly customised page, and you want to add a custom rewrite rule then this is article is definitely the one for you. We all know that WordPress is a powerful and pretty impressive blogging platform, and contains many useful features. The problem is finding the features [...]]]></description>
			<content:encoded><![CDATA[<p class="first">If you have written a WordPress Plug-in, or a highly customised page, and you want to add a custom rewrite rule then this is article is definitely the one for you.</p>
<p>We all know that <a href="http://wordpress.org/" target="_blank">WordPress</a> is a powerful and pretty impressive blogging platform, and contains many useful features. The problem is finding the features you need / want. Most of the time they are available &#8211; <em>somewhere</em>.<span id="more-423"></span></p>
<p>In this case, after a numbers of hours research, I&#8217;ve done all the hard work for you when it comes to adding custom rewrite rules. We shall assume we have a page called &#8220;<strong>directory</strong>&#8216;&#8221; with the page ID &#8220;<strong>123</strong>&#8221; and the parent page of name &#8220;<strong>business</strong>&#8220;.</p>
<p>This page <em>(ID: 123)</em> looks for the parameter &#8220;business&#8221; and if is defined, displays the details for the corresponding company. We also want to add the location of the business in the url, but for simplicity we will not pass them through in this example.</p>
<p>The end goal is to have a list of businesses displayed on &#8220;<strong>/business/directory/</strong>&#8221; with links to the business details in the format &#8220;<strong>/business/directory/york-yo31/mybusinessltd/</strong>&#8220;.</p>
<p>To achieve this, we will need to make use of three hooks. The first is the &#8220;<a href="http://codex.wordpress.org/Plugin_API/Action_Reference" target="_blank">init</a>&#8221; hook, which we will use to regenerate the rewrite rules and save them to the database using flush_rules().</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> directory_flush_rewrite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">flush_rules</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'directory_flush_rewrite'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The second hook is &#8220;<a href="http://codex.wordpress.org/Custom_Queries" target="_blank">query_vars</a>&#8220;. This is required to add the string &#8220;business&#8221; to the list of query variables WordPress understands in order for it to be retrieved on our directory page.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> directory_vars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$public_query_vars</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$public_query_vars</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'business'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$public_query_vars</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query_vars'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'directory_vars'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The last hook is called &#8220;<a href="http://codex.wordpress.org/Function_Reference/WP_Rewrite" target="_blank">generate_rewrite_rules</a>&#8221; and allows us to add the custom rewrite rule/s the list of WordPress rewrite rules. Putting the <strong>three code snippets together</strong> will result in the following block of code, which should be added to your &#8220;<strong>functions.php</strong>&#8221; file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> directory_flush_rewrite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">flush_rules</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'directory_flush_rewrite'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> directory_vars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$public_query_vars</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$public_query_vars</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'business'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$public_query_vars</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query_vars'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'directory_vars'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> directory_rewrite_rules<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_rewrite</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rules</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'business/directory/(?:\w+)-(?:\w+)/(.*)/?'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'index.php?page_id=123&amp;business='</span><span style="color: #339933;">.</span><span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">preg_index</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">rules</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'generate_rewrite_rules'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'directory_rewrite_rules'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The final piece of information you need is how to access the variable passed through form the rewrite rule (&#8220;<strong>business</strong>=mybusinessltd&#8221;). This can be done using using the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'business'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// returns 'mybusinessltd' in this example.</span></pre></div></div>

<p>The example Reg Exp used could be modified and improved nad the page name could be matched and used instead of using the page id, but should put you on the right track. As mentioned earlier, you could also pass through the the other parameters (town &amp; postcode) and use them alongside business in your lookup query.</p>
]]></content:encoded>
			<wfw:commentRss>http://36flavours.com/2009/10/extending-the-wordpress-mod_rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changed domain? Help Google and save Page Rank</title>
		<link>http://36flavours.com/2009/10/changed-domain-help-google-and-save-page-rank/</link>
		<comments>http://36flavours.com/2009/10/changed-domain-help-google-and-save-page-rank/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 14:40:31 +0000</pubDate>
		<dc:creator>Steve Whiteley</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[301]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://36flavours.com/?p=405</guid>
		<description><![CDATA[I recently changed my blog domain from sha.re.it to 36flavours.com and wanted to try and preserve my Google Page Rank with help from their Webmaster Tools, which provides a Change of Address tool. This tool tells Google that it&#8217;s the same site, just a new domain. Unfortunately for me, they don&#8217;t recognise &#8220;.re.it&#8221; as a [...]]]></description>
			<content:encoded><![CDATA[<p class="first">I recently changed my blog domain from sha.re.it to 36flavours.com and wanted to try and preserve my Google Page Rank with help from their <a href="http://www.google.com/support/webmasters/" target="_blank">Webmaster Tools</a>, which provides a Change of Address tool.</p>
<p>This tool tells Google that it&#8217;s the same site, just a new domain. Unfortunately for me, they don&#8217;t recognise &#8220;.re.it&#8221; as a root level domain, so was unable to make use of this feature.<span id="more-405"></span></p>
<p>Instead I have to rely on a <strong>301 redirect</strong>. If, like me, you&#8217;re using <strong>cPanel</strong> and have the old domain as a parked domain it will not issue a 301 header, however you can override this in your .htaccess file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteEngine On
RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>www\.<span style="color: #7a0874; font-weight: bold;">&#41;</span>?sha.re.it$
RewriteRule ^.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #ff0000;">&quot;http\:\/\/36flavours\.com\/$0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Here we check to see if the domain is <em>sha.re.it</em><strong> </strong>or <em>www.sha.re.it</em> and if so, redirect to <em>http://36flavours.com</em> with the <strong>301 header</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://36flavours.com/2009/10/changed-domain-help-google-and-save-page-rank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
