LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-08-2009, 12:26 PM   #1
Chrizzieej
Member
 
Registered: Jan 2007
Location: Netherlands, The
Posts: 51

Rep: Reputation: 15
Apache and automatic subdomains


Hello all,

I have a question about Apache, I want the following to happen:

When I go to www.testdomain.com Apache has to read the directory /var/www/testdomain.com/www. When I go to test.testdomain.com Apache had to read the directory /var/www/testdomain.com/test. I know I can make this happen with VirtualHosts, but I want to make it happen automatically. I've heard somewhere about mod_rewrite but I can not find the good code on the internet. Can somebody help me?

Thanx,
Chrizzieej
 
Old 01-08-2009, 01:06 PM   #2
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
That's the purpose of the VirtualHosts setup. You can use it for a different URL or a subdomain for your website. This will set up the different DocumentPath for the test.domain.com as you wish. I cannot think of any reason to do it otherwise unless you are on a shared server. Once set up it is fully automatic.

For a quick reference you can see: http://www.highrankings.com/forum/in...dpost&p=134812

Last edited by AuroraCA; 01-08-2009 at 01:13 PM. Reason: Forgot to add link
 
Old 01-09-2009, 02:27 AM   #3
Chrizzieej
Member
 
Registered: Jan 2007
Location: Netherlands, The
Posts: 51

Original Poster
Rep: Reputation: 15
But that's not what I want, when a user creates a new directory, for example linux.. I don't want to add a new VirtualHost. With something as mod_rewrite I want to let that go automatically. Offcourse I need a VirtualHost, but within that I want to let mod_rewrite do the work!
 
Old 01-09-2009, 03:04 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Is this what you are looking for?

http://www.webmasterworld.com/apache/3559132.htm
 
Old 01-09-2009, 05:23 AM   #5
Chrizzieej
Member
 
Registered: Jan 2007
Location: Netherlands, The
Posts: 51

Original Poster
Rep: Reputation: 15
Well something like that but I want it to use directories, not a php-script to redirect.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache and Subdomains Galaxy_Stranger Linux - Server 4 03-15-2008 02:20 AM
subdomains and apache, all on the same box vortmax Linux - Networking 1 01-29-2007 03:17 PM
Apache Subdomains Time Out jroggow Linux - Networking 3 08-12-2006 01:02 AM
APACHE and Subdomains basketkase999 Linux - Software 18 05-21-2005 10:38 PM
Apache and Subdomains, Help pzorn Linux - General 2 01-27-2004 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration