How can variable URLs be handled effectively in PHP using mod_rewrite?

Variable URLs can be handled effectively in PHP using mod_rewrite by creating a rewrite rule in the .htaccess file that redirects all requests to a single PHP script. This script can then parse the URL and determine the appropriate action based on the variables passed in the URL.

```php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
```

In the above code snippet, the mod_rewrite rules are used to redirect all requests to the index.php file, passing the requested URL as a query parameter. The PHP script can then parse this URL parameter and handle the request accordingly.