Hypertext Access file Rewriting and Redirecting SEO Friendly URLs


Example

Search engines won't index your products if you have a URL like the following:

http://www.yourdomain.com/product.php?id=123

SEO friendly URL would look like http://www.yourdomain.com/123/product-name/. The following code helps achieve this without having to change product.php code.

RewriteEngine On
RewriteRule ^product/([0-9]+)/product-name-slug/?$ product.php?id=$1