<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Rewriting for SEO-Friendly URLs: .htaccess or PHP?</title>
	<atom:link href="http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/</link>
	<description>Project Workshop</description>
	<lastBuildDate>Sun, 20 Nov 2011 15:21:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Anton Oliinyk</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-857</link>
		<dc:creator>Anton Oliinyk</dc:creator>
		<pubDate>Sun, 20 Nov 2011 15:21:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-857</guid>
		<description>Yes, you&#039;re right. Definitely some way is needed to establish a match between human-friendly URL directory names and database records. So &quot;slug&quot; fields do.
The only little difference in this particular sample case is that product slug have to be unique within category only as we use both category and product slugs to find a product. So there could be products with the same slug in other categories.</description>
		<content:encoded><![CDATA[<p>Yes, you&#8217;re right. Definitely some way is needed to establish a match between human-friendly URL directory names and database records. So &#8220;slug&#8221; fields do.<br />
The only little difference in this particular sample case is that product slug have to be unique within category only as we use both category and product slugs to find a product. So there could be products with the same slug in other categories.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Speedt_ouch</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-852</link>
		<dc:creator>Speedt_ouch</dc:creator>
		<pubDate>Sat, 19 Nov 2011 23:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-852</guid>
		<description>Hi.
So I figure the slug field would be the same thing has the numeric ID field, only that contains words.
Making sure there are no duplicate slag names also.
Ill give it a try.

Thanks for the example.</description>
		<content:encoded><![CDATA[<p>Hi.<br />
So I figure the slug field would be the same thing has the numeric ID field, only that contains words.<br />
Making sure there are no duplicate slag names also.<br />
Ill give it a try.</p>
<p>Thanks for the example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Oliinyk</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-844</link>
		<dc:creator>Anton Oliinyk</dc:creator>
		<pubDate>Thu, 17 Nov 2011 18:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-844</guid>
		<description>Say, category table is:
id, slug, label
1, appliances, Appliances
2, network, Network
3, video, Video
...

And product table is:
id, category_id, slug, label, description
1, 1, blender, Blender, This is cool blender
2, 1, water-filter, Water Filter, This is cool water filter
3, 2, router, D-Link DIR-300, This is not so cool network router
...

Now you get request for /products/network/router.html 
which is rewritten to products.php?category=network&amp;product=router

Now let&#039;s query product data:
&lt;code&gt;
$rs = $db-&gt;query(&quot;
    SELECT `product`.* FROM `product`
    JOIN `category` ON `product`.`category_id` = `category`.`id` 
    WHERE `product`.`slug` = &#039;{$db-&gt;real_escape_string($_GET[&#039;product&#039;])}&#039; AND `category-&gt;slug` = &#039;{$db-&gt;real_escape_string($_GET[&#039;category&#039;])}&#039;&quot;);
&lt;/code&gt;

The result set will contain single record for the product with ID 3.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Say, category table is:<br />
id, slug, label<br />
1, appliances, Appliances<br />
2, network, Network<br />
3, video, Video<br />
&#8230;</p>
<p>And product table is:<br />
id, category_id, slug, label, description<br />
1, 1, blender, Blender, This is cool blender<br />
2, 1, water-filter, Water Filter, This is cool water filter<br />
3, 2, router, D-Link DIR-300, This is not so cool network router<br />
&#8230;</p>
<p>Now you get request for /products/network/router.html<br />
which is rewritten to products.php?category=network&#038;product=router</p>
<p>Now let&#8217;s query product data:<br />
<code><br />
$rs = $db->query("<br />
    SELECT `product`.* FROM `product`<br />
    JOIN `category` ON `product`.`category_id` = `category`.`id`<br />
    WHERE `product`.`slug` = '{$db->real_escape_string($_GET['product'])}' AND `category->slug` = '{$db->real_escape_string($_GET['category'])}'");<br />
</code></p>
<p>The result set will contain single record for the product with ID 3.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Speedt_ouch</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-843</link>
		<dc:creator>Speedt_ouch</dc:creator>
		<pubDate>Thu, 17 Nov 2011 16:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-843</guid>
		<description>Hi,
Thanks for the reply.
Could you kindly provide an example please?

I would like to keep the &quot;fake URL&quot; with out any numeric values.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for the reply.<br />
Could you kindly provide an example please?</p>
<p>I would like to keep the &#8220;fake URL&#8221; with out any numeric values.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Oliinyk</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-842</link>
		<dc:creator>Anton Oliinyk</dc:creator>
		<pubDate>Thu, 17 Nov 2011 15:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-842</guid>
		<description>Hi!
You&#039;ll have to query database using string IDs you use in URLs. Say, you can add a field &#039;slug&#039; to category and product tables and look up records by that field.</description>
		<content:encoded><![CDATA[<p>Hi!<br />
You&#8217;ll have to query database using string IDs you use in URLs. Say, you can add a field &#8216;slug&#8217; to category and product tables and look up records by that field.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Speedt_ouch</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-841</link>
		<dc:creator>Speedt_ouch</dc:creator>
		<pubDate>Thu, 17 Nov 2011 14:25:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-841</guid>
		<description>Hi,
Thanks for sharing this.
I have some questions I hope you can clarify.

I normally user rewrite mod with the unique numeric ID of the information I need, in order to query the mysql database.
With your example there is no numeric ID.
Now I&#039;m confused :)
There is where my questions start.

Imagine I have a product
products.php?category=network&amp;product=1
products.php?category=network&amp;product=2

How can I make 
/products/network/router.html open products.php?category=network&amp;product=1
and 
/products/network/cable.html open products.php?category=network&amp;product=2

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Thanks for sharing this.<br />
I have some questions I hope you can clarify.</p>
<p>I normally user rewrite mod with the unique numeric ID of the information I need, in order to query the mysql database.<br />
With your example there is no numeric ID.<br />
Now I&#8217;m confused <img src='http://pumka.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
There is where my questions start.</p>
<p>Imagine I have a product<br />
products.php?category=network&amp;product=1<br />
products.php?category=network&amp;product=2</p>
<p>How can I make<br />
/products/network/router.html open products.php?category=network&amp;product=1<br />
and<br />
/products/network/cable.html open products.php?category=network&amp;product=2</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Oliinyk</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-468</link>
		<dc:creator>Anton Oliinyk</dc:creator>
		<pubDate>Mon, 02 May 2011 12:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-468</guid>
		<description>Katie, what exactly do you do?
You can email me sample code and I&#039;ll take a look.</description>
		<content:encoded><![CDATA[<p>Katie, what exactly do you do?<br />
You can email me sample code and I&#8217;ll take a look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Katie @ women magazine</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-467</link>
		<dc:creator>Katie @ women magazine</dc:creator>
		<pubDate>Mon, 02 May 2011 12:27:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-467</guid>
		<description>When i do this my site page goes into infinite loop looking for sub-directories and never opens the page. What&#039;s wrong?</description>
		<content:encoded><![CDATA[<p>When i do this my site page goes into infinite loop looking for sub-directories and never opens the page. What&#8217;s wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton Oliinyk</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-319</link>
		<dc:creator>Anton Oliinyk</dc:creator>
		<pubDate>Thu, 10 Jun 2010 20:33:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-319</guid>
		<description>Looks like a side-effect of &lt;a href=&quot;http://httpd.apache.org/docs/2.1/mod/mod_userdir.html&quot; rel=&quot;nofollow&quot;&gt;mod_userdir&lt;/a&gt; Apache module.
I think it&#039;s no possible to stop with rewriting as the request never actually comes to your virtual host.
I suggest to ask your hosting provider to disable mod_userdir at least for your virtual host or to move to another hosting with mod_userdir disabled.</description>
		<content:encoded><![CDATA[<p>Looks like a side-effect of <a href="http://httpd.apache.org/docs/2.1/mod/mod_userdir.html" >mod_userdir</a> Apache module.<br />
I think it&#8217;s no possible to stop with rewriting as the request never actually comes to your virtual host.<br />
I suggest to ask your hosting provider to disable mod_userdir at least for your virtual host or to move to another hosting with mod_userdir disabled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roch</title>
		<link>http://pumka.net/2009/12/30/rewriting-for-seo-friendly-urls-htaccess-or-php/comment-page-1/#comment-318</link>
		<dc:creator>Roch</dc:creator>
		<pubDate>Tue, 08 Jun 2010 23:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pumka.net/?p=207#comment-318</guid>
		<description>Do you know of anyway with htaccess to disable someone from using your domain to point to their own website on the same server? Ex: they use YOURDOMAIN.com to promote their PHISHING WEBSITE.COM by using this simple URL to send users : YOURDOMAIN.COM/~phishing/file.html

Any help would be greatly appreciated. Thanks</description>
		<content:encoded><![CDATA[<p>Do you know of anyway with htaccess to disable someone from using your domain to point to their own website on the same server? Ex: they use YOURDOMAIN.com to promote their PHISHING WEBSITE.COM by using this simple URL to send users : YOURDOMAIN.COM/~phishing/file.html</p>
<p>Any help would be greatly appreciated. Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

