Subdomains with .htaccess (PHP)
141
I am looking to create a .htaccess file on my website to allow me enter "username.domain.com" as the url and it redirects me to "http://domain.com/index.php?a=profile&u=username"
eg: "john.domain.com" redirects to "http://domain.com/index.php?a=profile&u=john"
Thanks
Answer
Solution:
This would not go into .htaccess, it would go into you httpd.conf file. Look into this question: VirtualHost with wildcard VirtualDocumentRoot
You would also need to setup a wildcard dns record for *.example.com to point to your server. In PHP you would have something like this as the index.php file for your wildcard.