Jump to content

Creating Pseudo Subdomains


chesterthebear

Recommended Posts

Hi All,

 

I'm very new to Apache, so please forgive me if the jargon isn't right.

 

I have a Debian based Apache 2 server, and I want to create pseudo subdomains.  As I understand it, this is achieved through an entry in one of the Apache conf files.

 

For example, lets say we have the domain 'domain.tld'.  I want to create 'sub.domain.tld'.  The 'real' way to do it takes time to become active, and seems overly complex (even though the control panel I'm using creates it all for me), AND isn't accessible as http://www.sub.domain.tld, only as http://sub.domain.tld. 

 

I read a reference somewhere on the web that talked about 'pseudo' subdomains, which are just Apache redirects to the content of directories within domain root directory (the html folder).  Unfortunately, it didn't detail how to do that.

 

What I'm looking for is a single entry in an Apache .conf file that reads the request 'sub.domain.tld' and simply redirects to domain.tld/sub (while leaving the displayed address as 'sub.domain.tld').  If /sub doesn't exists, an error is generated.  As soon as /sub is created, the redirect comes into effect and sub.domain.tld works.

 

Is this possible?

If so, how do I get it done?

 

Thanks

CTB

Link to comment
Share on other sites

Take a look at virtual hosts. My configs are at:

 

http://wiki.kartbuilding.net/index.php/Apache_2_%26_SSL_-_PHP4_-_MySQL_4.1

 

I also have a video for setting up a virtual host for apache2 (ubuntu and debian are identical in this setup).

http://www.skynet.ie/~%20steviewdr/videos/apache2_ssl_ubuntu/apache2_ssl_ubuntu.html

 

-steve

Link to comment
Share on other sites

  • 2 weeks later...
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.