What is the purpose of mod_rewrite in PHP?

Mod_rewrite in PHP is used to rewrite URLs in a more user-friendly format. It allows you to create search engine friendly URLs that are easier to read and understand. This can improve the overall user experience and can also help with SEO by making your website more accessible to search engines.

RewriteEngine On
RewriteRule ^products/([0-9]+)/?$ product.php?id=$1 [NC,L]