Jaimie Sirovich , [ www.seoegghead.com ]
The following code demonstrates some of the functions we use:
| <?php require_once('mod_rewrite.inc.php'); echo 'This is _clean_url_text("carpenter\'s tools"):<br>'; echo _clean_url_text("carpenter's tools"); // == 'carpenters-tools' echo '<br><br>'; echo 'This is _clean_url_text("black and white"):<br>'; echo _clean_url_text('black and white'); // == 'black-and-white' echo "<br><br>"; echo 'This is make_product_url("carpenter\'s tools", 1, "belt sander", 2):<br>'; echo make_product_url("carpenter's tools", 1, 'belt sander', 2); // == '/Products/carpenters-tools-1/belt-sander-2.html' echo "<br><br>"; echo 'This is make_product_url("hammers", 3, "big and mighty hammer", 4):<br>'; echo make_product_url('hammers', 3, 'big and mighty hammer', 4); // == '/Products/hammers-3/big-and-mighty-hammer-4.html' echo "<br><br>"; ?> |
This is _clean_url_text("carpenter's tools"):
carpenters-tools
This is _clean_url_text("black and white"):
black-and-white
This is make_product_url("carpenter's tools", 1, "belt sander", 2):
/Products/carpenters-tools-1/belt-sander-2.html
This is make_product_url("hammers", 3, "big and mighty hammer", 4):
/Products/hammers-3/big-and-mighty-hammer-4.html
These two links are functionally the same; click to see it in action:
/products.php?category_id=1&product_id=2
/Products/carpenters-tools-1/belt-sander-2.html
| Click here for the source code to .htaccess |
| Click here for the source code to mod_rewrite.inc.php |
| Click here for the source code to this page (index.php) |
| Click here for the source code to the rewritten products page (products.php) |
| http://www.seoegghead.com/blog/seo/keywords-in-urls-revisited-p85.html |
| www.lawyerseek.com |
| http://video.google.com/videoplay?docid=-6860320126300142609 |