What are some best practices for rewriting URLs in PHP to make them more search engine friendly?

One way to make URLs more search engine friendly in PHP is to use URL rewriting to create cleaner and more descriptive URLs. This can be achieved by using Apache's mod_rewrite module to rewrite URLs in a more user-friendly format. By rewriting URLs, you can improve the readability of your URLs for both users and search engines, which can help improve your site's SEO.

```php
RewriteEngine On
RewriteRule ^products/([0-9]+)/([a-zA-Z0-9_-]+)$ product.php?id=$1&name=$2 [NC,L]
```

In this example, the code snippet uses mod_rewrite to rewrite a URL from `product.php?id=123&name=example-product` to `products/123/example-product`. This makes the URL more user-friendly and easier for search engines to understand.