Let's say you have a links directory script. To view a category you have to go to this URL:
http://www.yourdomain.com/category.php?id=10
Now as some of you might know some Search Engines can't index anything after the
?. However a lot of Search Engines now have this feature.
But you still want to display the categories in amore Search Engine friendly format. How can you do this?
Easily, you can do this with a .htaccess file and a bit of code within it.
Here's the code to save in the .htaccess file:
Code:
##### Start the engine
RewriteEngine On
##### Set a base rule to /
RewriteBase /
##### Match the string and parse the query
RewriteRule ^category-([0-9]+).html$ /category.php?id=$1
That's it! Upload the .htaccess file and instead of linking to:
http://www.yourdomain.com/category.php?id=10
You can now link to:
http://www.yourdomain.com/category-10.html
And the Search Engines can now easily index your page
Enjoy!
Tech