gdhanasekar Posted July 16, 2008 Share Posted July 16, 2008 Hi all, I need to know the details for to creating the virtual sub domains (like http://user.domain.com). I found that , we need wild card dns facility for hosting account in order to create such virtual sub domains. I have enabled the wild card dns feature in my hosting but I dont know how to create this. I have to create the virtual sub domains for my website. i.e. http://www.mydomain.com/profile.php?mid=screenname to http://screenname.mydomain.com if anyone knows this, please post it. Thanks and Regards!!! gdhanasekar Quote Link to comment https://forums.phpfreaks.com/topic/115015-how-to-create-a-virtual-subdomain-using-htaccess/ Share on other sites More sharing options...
mxicoders Posted August 4, 2008 Share Posted August 4, 2008 Hi My name is ashok I am working with www.mxicoders.com We are also looking for same solution Regards Quote Link to comment https://forums.phpfreaks.com/topic/115015-how-to-create-a-virtual-subdomain-using-htaccess/#findComment-607287 Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain.com RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com RewriteRule ^(.*)$ /profile.php?mid=%1 Quote Link to comment https://forums.phpfreaks.com/topic/115015-how-to-create-a-virtual-subdomain-using-htaccess/#findComment-607344 Share on other sites More sharing options...
murtuza.hasan.13 Posted March 3, 2010 Share Posted March 3, 2010 this is what i am doing: RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC] RewriteRule ^(.*)$ http://www.example.com/controller/action/%1 [L] My problem is the page is getting changed along with the URL. I dont want to the URL to get changed. What should i do. Please help and if i change RewriteRule ^(.*)$ http://www.example.com/controller/action/%1 [L] as RewriteRule ^(.*)$ /controller/action/%1 [L] Its giving Internal Server Error. Please help. Thanks RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.mydomain.com RewriteCond %{HTTP_HOST} ([^.]+)\.mydomain.com RewriteRule ^(.*)$ /profile.php?mid=%1 Quote Link to comment https://forums.phpfreaks.com/topic/115015-how-to-create-a-virtual-subdomain-using-htaccess/#findComment-1020849 Share on other sites More sharing options...
cliffdodger Posted August 25, 2010 Share Posted August 25, 2010 If you're still looking for an answer see if this thread can help http://www.phpfreaks.com/forums/index.php/topic,308319.new.html#new Quote Link to comment https://forums.phpfreaks.com/topic/115015-how-to-create-a-virtual-subdomain-using-htaccess/#findComment-1103733 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.