Well, im trying to get user profiles to be in a virtual directory e.g: http://mydomain.com/profiles.php?user=test and i want to get it to display something like http://test.mydomain.com, could someone please post me the EXACT full .htaccess file for that example please? Thanks
Seems to be same as this thread. According to that thread you can't do it with a .htacess file. Sky22
htaccess alone cant do it , because you will need your nameserver to resolve the wildcard subdomain. please go through this ... http://www.decodephp.com/2006/10/12/virtual-subdomains-and-php/
Enable it using a server alias as discussed in the above links or if you are on a shared host and have CPanel or something similar, you can add *.example.com in the subdomain manager. Then in your .htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.+)\.example\.com [NC] RewriteRule .* /profiles.php?user=%1 [R=301,L]
Well, What i want it when i type http://mydomain.com/whatever in the browser, it should use the following url http://mydomain.com/profile.php?user=whatever Thanx
this one isnt a problem RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ profile.php?user=$1 [QSA]