I want to use .htaccess to rewrite to a folder based on the visitors IP-address. I have a list of IP-addresses with associated usernames (in a text file). The usernames are also the folder names.
- 192.168.0.2 - John
- 192.168.0.3 - Ben
Example: when John (IP ..0.2) goes to www.domain.com, he must see the the content of folder /John
Because the username-IP binding will be made in PHP, I prefer to use RewriteMap so I can generate a .txt file.
Unfortunately, I have to idea where to start. Rewriting based on the users IP is not the problem, the problem is finding the linked username.
Any help appreciated!