Mobile app version of vmapp.org
Login or Join
Alves908

: Using subdomain without frame, but keeping sub.domain.com in the address bar? I'd like to make a download folder on my Server that's accessible via http://download.domain.com/ and host files like

@Alves908

Posted in: #301Redirect #Dns #Domains #Subdirectory

I'd like to make a download folder on my Server that's accessible via download.domain.com/ and host files like file.txt there.

This works with a URL frame, but they have to be includable via javascript (This doesn't seem to work when using a frame). Also if I just visit download.domain.com without specifying a file I use the index.php file to redirect back to domain.com

How can I make file.txt reachable via download.domain.com/file.txt and don't show the real path in the address bar. Also if I get redirected to domain.com from the download.domain.com URL how can I show the real address in the addressbar (This doesn't seem to work when using a frame either).

I'm a bit lost since this is my first server with an actual toplevel domain and all this frame/ redirect/ a address stuff still is a bit confusing.

Thank you in advance for your answer.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

There are two basic ways that most domain name providers will use to set up a host name for a web site:


Point it at their own server and put a page there which contains only a frame pointing at another URL. This is awful.
Point it at an IP address. This is how it should be done.


Once the host name is pointing at the right IP address you need to have a HTTP server running on the computer with that address. (That is simplifying things a little, you can involve proxies along the way).

When a browser makes a request for the URL, it will look up the IP address from the domain and and then make an HTTP request which will include the hostname, path and query segments of the URL.

A very basic configuration of a web server will ignore the host part and only care about the path part.

You need to make sure you pay attention to the host part so you can serve up different content based on the hostname.

How you do this will depend on the HTTP server software you use.

The normal way to do this in Apache HTTPD is to configure a Virtual Name Host and give it a different DocumentRoot to the other site.

Cheap hosting might not give you that level of configuration, but might let you use mod_rewrite to change the path internally based on a variety of factors that include the host name.

Of course, you might be using some other HTTP server entirely. You'll need to investigate what options your host provides.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme