Jump to content

subdomains masking directories


patawic

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.