<?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>Connecting the dots... &#187; SEO</title>
	<atom:link href="http://blog.rajatpandit.com/tag/seo/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajatpandit.com</link>
	<description>Thoughts on Web Development, Infrastructure and Application Scalability</description>
	<lastBuildDate>Thu, 29 Dec 2011 13:21:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>SEO Glossary</title>
		<link>http://blog.rajatpandit.com/2009/01/25/seo-glossary/</link>
		<comments>http://blog.rajatpandit.com/2009/01/25/seo-glossary/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 18:42:50 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=157</guid>
		<description><![CDATA[I have recently started to be more interested in upgrading my skills for search engine optimization. This category will contain my learnings in this area. The problem with starting reading...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-158" style="margin: 10px;" src="http://blog.rajatpandit.com/wp-content/uploads/2009/01/eye2.gif" alt="" width="315" height="332" /></p>
<p>I have recently started to be more interested in upgrading my skills for search engine optimization. This category will contain my learnings in this area. The problem with starting reading about new things is that most of the articles contain lot of abbreviations and sometimes without their full forms, you might loose the essence of what they really are talking about. Most people might already be familiar with these, but I am listing most of them just as a good starting point for anyone starting to read:</p>
<dl lang="en" style="clear:both">
<dt><strong>SEO</strong></dt>
<dd>Search Engine Optimization</dd>
<dt><strong>SEM</strong></dt>
<dd>Search Engine Marketing</dd>
<dt><strong>PR</strong></dt>
<dd>Page Rank</dd>
<dt><strong>CPC</strong></dt>
<dd>Cost Per Click</dd>
<dt><strong>PPC</strong></dt>
<dd>Pay Per Click</dd>
<dt><strong>CTR</strong></dt>
<dd>Click-trough Rate</dd>
<dt><strong>Landing Page</strong></dt>
<dd>A Keyword focussed page designed to convert</dd>
<dt><strong>&#8220;Above the fold&#8221;</strong></dt>
<dd>First screen of page visible.</dd>
<dt><strong>SERP</strong></dt>
<dd>Search Engine Results Page</dd>
<dt><strong>ROI</strong></dt>
<dd>Return on investment</dd>
</dl>
<p>If there are some more that you know off, please add them in the comments section.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2009/01/25/seo-glossary/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating clean SEO urls in symfony</title>
		<link>http://blog.rajatpandit.com/2008/06/18/creating-clean-seo-urls-in-symfony/</link>
		<comments>http://blog.rajatpandit.com/2008/06/18/creating-clean-seo-urls-in-symfony/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 12:22:56 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Clean]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[YML]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=26</guid>
		<description><![CDATA[Being the symfony fan that I am, I have decided to start documenting some of the features I think are quite neat in the framework. So starting today, here&#8217;s a...]]></description>
			<content:encoded><![CDATA[<p>Being the <a href="http://www.symfony-project.org/">symfony</a> fan that I am, I have decided to start documenting some of the features I think are quite neat in the framework. So starting today, here&#8217;s a quick quite to writing a Search Engine Optimized URL.<br />
So I am working on a project where users will be posting university details and I wanted the university names to appear on the url instead of the id. The problem with ID&#8217;s is it gives too much information about the application and if not carefully design can lead to data being exposed which the development might have not intented do.</p>
<p>So here&#8217;s the url that I was looking for. </p>
<pre class="brush: xml; title: ; notranslate">

http://testsite.rajatpandit.com/university/Indian_institute_of_management_ahemdabad.html
</pre>
<p>I got to the point where I had functional code which gave me URLs like these:</p>
<pre class="brush: xml; title: ; notranslate">

http://testsite.rajatpandit.com/university/id/1
</pre>
<p>These are the steps to convert the URLs are humanly understandable.<br />
Step 1:<br />
Add additional field to the university table to store the modified name. So  update the schema to addt the additional field.<br />
[yml]<br />
university:<br />
    _attribute: {phpName: University}<br />
    id: {type: integer, required: true, primaryKey: true, autoincrement: true}<br />
    name: varchar(256)<br />
    stripped_name: varchar(256)<br />
    website: varchar(256)<br />
    country: varchar(2)<br />
    city: varchar(256)<br />
    body: longvarchar<br />
    approved: boolean<br />
    created_at:<br />
    updated_at:<br />
[/yml]</p>
<p>Obviously  you would need to do the regular to regenerate the models.</p>
<pre class="brush: bash; title: ; notranslate">
#symfony propel-build-model
#symfony propel-build-sql
#symfony propel-insert-sql
</pre>
<p>or do it all in one easy step.</p>
<pre class="brush: bash; title: ; notranslate">
#symfony propel-build-all
</pre>
<p>Step 2:<br />
Now modify the model to update the new column (stripped_name) every time the standard <code>setName($v)</code> is called. For that we need to have a helper function that does this. Here&#8217;s the code I used, you can use your own version.</p>
<pre class="brush: php; title: ; notranslate">
function stripText($text) {
  $text = strtolower($text);
  $text = preg_replace('/\W/', ' ', $text);
  $text = preg_replace('/\ +/', '_', $text);
  $text = preg_replace('/\-$/', '', $text);
  $text = preg_replace('/^\-/', '', $text);
  return $text;
}
</pre>
<p>I create a new file called <code>CustomHelper.php</code> and store in under <code>lib/helper/</code> and then update the model class for <code>University</code> to override the function <code>setName($v)</code> with the following function.</p>
<pre class="brush: php; title: ; notranslate">
public function setName($v)
  {
    include_once('lib/helper/CustomHelper.php');
    parent::setName($v);
    $this-&gt;setStrippedName(stripText($v));
  }
</pre>
<p>That will ensure that the new column <code>stripped_name</code> gets updated.</p>
<p>Step 3:<br />
Update  your php template where you create the links to the following code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;ul&gt;
  &lt;?php foreach($universities as $university): ?&gt;
    &lt;li&gt;
      &lt;?php echo link_to($university-&gt;getName(), '@university_display?stripped_name=' . stripText($university-&gt;getName())); ?&gt;
    &lt;/li&gt;
  &lt;?php endforeach; ?&gt;
&lt;/ul&gt;
</pre>
<p>and update the routing.yml to match the routing name used.</p>
<p>[yml]<br />
article_display:<br />
  url: /article/:stripped_title.html<br />
  param: {module: home, action: article}<br />
[/yml]<br />
The routing rule reads out like this,<br />
When you see the url containing /article/&lt;something&gt;.html redirect it to module: home to its action article and assign a request parameter &lt;stripped_html&gt; to  &lt;something&gt;.</p>
<p>and that&#8217;s all you need to do to get your urls look all nice and clean.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2008/06/18/creating-clean-seo-urls-in-symfony/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

