How does PHP handle URL rewriting compared to other languages?

URL rewriting in PHP is typically handled using the .htaccess file on Apache servers. By configuring the .htaccess file, you can rewrite URLs to make them more user-friendly or to improve SEO. This is commonly used to create clean URLs that are easier to read and understand.

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?username=$1