Dynamic meta robots
<p>I am trying to find the best way to create a dynamic meta robots section. I have a search engine and only want the main search "with all categories searched together" indexed by google and others. I want any category searches to be NOINDEX so I do not get duplication penalties for possibly having alot of the same text showing on a different search page. I made it so if "category" is in the url to make it NOINDEX like this.</p>

<pre><code>&lt;?php if (!isset($_GET['category'])) echo "&lt;meta name='robots' content='all'&gt;"; if (isset($_GET['category'])) echo "&lt;META NAME='ROBOTS' CONTENT='NOINDEX, NOFOLLOW'&gt;"; ?&gt;
</code></pre>

<p>It seems to work fine this, it makes the normal search have this meta robots</p>

<pre><code>&lt;meta name="robots" content="all"&gt;
</code></pre>

<p>And if any category is searched the meta robots look like this</p>

<pre><code>&lt;META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"&gt;
</code></pre>

<p>Just wondering if this the best way to do this? Anyone have any suggestions? Thanks.</p>

<p>EDIT:
I am assuming that since no one has replied that this is the way to go. Hope this possibly helps someone else someday. Thanks for viewing.</p>
