Forum Moderators: phranque
NOTE: I have already written Options +FollowSymlinks and RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^.]+)\.profiles\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/profiles.php?name=%1 [L]
[edited by: jdMorgan at 12:30 am (utc) on Sep. 19, 2008]
[edit reason] example.com [/edit]
Is this code in .htaccess, or in httpd.conf?
If in .htaccess, are you sure that all subdomains have this .htaccess file's directory as their DocumentRoot?
Please define "doesn't work."
How did you test?
What were the results?
How did the results differ from your expectations?
Anything in your server error log?
Jim
*.profile.example.com. A 123.45.67.89
or
*.profile.example.com. CNAME example.com
Note the trailing period on the domain -- It is required.
Jim
It will take anywhere from four hours to several days before these new subdomains resolve to your server -- It takes time for the updated zone file to propagate world-wide, to every ISP, etc.
Next, you'll need to be sure that your server knows where to send requests for these subdomains. Hopefully, your control panel can be used to point them all to your main folder, but this is not always the case. In some cases, it won't let you define subdomains (sorry, pay extra), and in others, it points them to a subdirectories of your main filespace, and there is no choice about that. And it may not be possible to define the "wildcard" sub-sub-domain that you intend to put the username into, and that means that you will then have to use the control panel to define each and every user account -- In short, you'll need a better/more flexible host at that point...
Jim