How can Apache URL rewrite be used to create user-friendly URLs in PHP?
To create user-friendly URLs in PHP using Apache URL rewrite, you can use the mod_rewrite module to rewrite URLs in a more readable format. This can help improve the user experience and make your URLs more search engine friendly. By creating rewrite rules in your .htaccess file, you can map user-friendly URLs to the actual PHP files on your server. ```apache RewriteEngine On RewriteRule ^user/([a-zA-Z0-9_-]+)$ profile.php?username=$1 ``` In this example, a URL like "example.com/user/johndoe" will be internally rewritten to "example.com/profile.php?username=johndoe". This way, users see a clean and user-friendly URL while the server processes the request correctly.