patawic Posted March 28, 2012 Share Posted March 28, 2012 My website (http://www.gamerstats.net) uses a domain of card.gamerstats.net to display gamercards. Recently my host had an issue with a harddrive that my server (is a vps, not web hosting) is hosted on and i was unable to retrieve my httpd.conf file which handled the subdomain. Basically i need to make the subdomain card.gamerstats.net mask over the top of gamerstats.net/card/ For example http://www.gamerstats.net/card/xbox/nxe/Xifictor/1/ would be masked as http://card.gamerstats.net/xbox/nxe/Xifictor/1/ A quick response would be wonderful as i need to get my website functioning as soon as possible I would prefer to do it using A records and httpd.conf But if its possible to do it using a .htaccess file, that will also work. Quote Link to comment https://forums.phpfreaks.com/topic/259857-subdomains-masking-directories/ Share on other sites More sharing options...
patawic Posted March 28, 2012 Author Share Posted March 28, 2012 sorry for the delayed response, the edit button disappeared. It appears that i cant do it with a .htaccess file, as i have separate htaccess files in my card directories (eg. in the nxe folder) That handles further rewrites. It must be done in the httpd.conf file. Quote Link to comment https://forums.phpfreaks.com/topic/259857-subdomains-masking-directories/#findComment-1331816 Share on other sites More sharing options...
patawic Posted March 28, 2012 Author Share Posted March 28, 2012 Well that was stupid of me, Completely forgot that you have to restart apache for it to reload the config. Fixed it by doing this Listen 80 NameVirtualHost * <VirtualHost *> ServerName www.gamerstats.net DocumentRoot C:\xampp\htdocs </VirtualHost> <VirtualHost *> ServerName card.gamerstats.net DocumentRoot C:\xampp\htdocs\card </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/259857-subdomains-masking-directories/#findComment-1331817 Share on other sites More sharing options...
trq Posted March 28, 2012 Share Posted March 28, 2012 And what exactly is your question / problem? Just make a new vhost and setup it's Document root to use the *card* directory. At it's simplest: <VirtualHost *:80> ServerName card.gamerstats.net DocumentRoot "/path/to/card" </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/259857-subdomains-masking-directories/#findComment-1331818 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.