View Single Post
Old 07-15-2009, 02:55 PM   #2 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

htaccess:
Code:
Options +FollowSymlinks
RewriteEngine On

Options -MultiViews

RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com [NC]
RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\.yourdomain\.com
RewriteRule (.*) _controller.php?username=%1&module=$1 [L,QSA]
Replace yourdomain with your domain name. The subdomain displays what ?username= returns so if you go to example.domain.com it displays _controller.php?username=example - however it doesnt show this, appears as the subdomain still. Going to example.domain.com/hi displays _controller.php?username=example&module=hi. If you bump into any problems, let me know :)

I'm not sure how you'd link it with the id but maybe that's because I've been staring at my screen too long.
Sam Granger is offline  
Reply With Quote