Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Essentially there is a domain = X .

There is a institute server and I have access to one section /~Y/ .

How to make X point to /~Y/Z/ ?

share|improve this question
A domain has nothing to do with folders. If you are talking about vhosts in some webserver you should tell us the type of webserver you are using – Thomas Berger Aug 22 '11 at 18:15
up vote 1 down vote accepted

I'm assuming you don't have a web-server of you own.

If you want www.yourdomain.tld to point to
1. You should setup a CNAME record that points from www.youdomain.tld to example.tld
2. The webmaster of example.tld will have to make a vhost for www.yourdomain.tld

If you want yourdomain.tld to point to example.tld/~username/subfolder
1. You must setup an A record that points to the IP address of
2. The webmaster of example.tld will have to make a vhost for yourdomain.tld

If you want example.tld to point to example.tld/~username/subfolder,
you'll have to talk to the webmaster of example.tld, though I doubt they'll grant that request.

share|improve this answer

First, I'm assuming you're referring to "http" requests... HTTP is a VERY small piece in the grand scheme of things. Similar domain & path layouts can be used with a variety of services... let me know if I assumed incorrectly.

From what it sounds like, you need to setup a redirect to that URL. i.e. http://X redirects to http://X/~Y/Z/. If you wanted http://X to redirect to http://Y/~username/Z the same rule applies. Different web servers have different ways of accomplishing this. The simplest of which is to provide a default 'index.html' which sets certain header values to redirect the user to the proper URL. Something ends up looking like this:

HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Content-Length: 174   
<p>This page has moved to <a href=""></a>.</p>

Keep in mind that simply creating a index.html text file and pasting this into the file won't work in many cases. Header values are typically set using some method in the programming environment you are using... and this can vary greatly depending on the programming language.

Depending on your web-server flavor/configuration, there may be other alternatives, like setting up a proxy, but this is rarely as good of an idea as it sounds. I wouldn't suggest doing this on a production site. With Apache, you can use mod_proxy, but this doesn't always work well, as you must rewrite links & references on the fly to ensure that the correct domain name & path are used. There are additional tools to do this automatically, but they're quite complex, and probably not what you're looking for.

More information would be helpful. Most importantly, What kind of web server? what kind of access/control do you have on it? Is it hosing other websites? Can the application handle alternate paths or is everything hard-coded? etc...

share|improve this answer
Is it not possible to set headers via an ordinary html file. At least not on apache – Thomas Berger Aug 22 '11 at 19:42
Not always. Depends on several factors. – TheCompWiz Aug 22 '11 at 19:50
Never seen this possible in 8 years of system administration. Could you give some more infos about that? – Thomas Berger Aug 22 '11 at 20:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.