Hi there, I want to make subdomain url rewrite for categories and user profiles.. For example: category.mysite.com -> categories.php?kat=category username.mysite.com -> profiles.php?prof=username How can I do this? I was thinking about rewriting it to check.php?check=$1, which will check if category exists and include categories.php. If not include profiles.php. Is this good solution or is another(better) way to do this (Apache+PHP)? Thank you for answers.
For that to work you have to first enable wildcard subdomains in either cpanel or apache settings, so that *.mysite.com get resolved to the same ip address and directory. There is a few threads on this here's one, http://forums.digitalpoint.com/showthread.php?t=33868
Don't be discouraged! Wildcards works also without dedicated IP, you can do it by playing with the .htaccess file that usually is invisible (unix: .dottedfiles - yes the dot is before the filename - are invisibles) so you need to turn on on your FTP client the "Show invisible files". Then you'll need to edit the .htaccess! And as Narrator said, visit this link:http://forums.digitalpoint.com/showthread.php?t=33868 - This is the solution