Forum Moderators: phranque
The script is then executed during the URL-to-filename translation phase of the Apache API, and returns the translated value to mod_rewrite in httpd.conf, conf.d, or even in .htaccess. However, server config access is required in order to define the RewriteMap.
Alternatively, you could rewrite all /username requests to a modfied version of your /user.php script, have the script look up the uid, and then return (that is, 'include') appropriate page content for each user.
Be aware that the links you publish on your pages must be in /username form, and you then need to translate those URLs, when requested from your server, to the /user.php?id=uid form to properly invoke your page-delivery script.
A problem you'll need to consider is that you must 'tag' the /username URLs in some way so that they can be differentiated from normal subdirectory requests -- The server must be given some way to tell, for example, a request for the 'well-known' privacy policy file named /w3c/p3p.xml from a request for username 'w3c'.
This can be done by using a URL prefix, such as /users/username, by using a subdomain such as [users.example.com,...] or any other method that makes the distinction explicit.
Jim