Apache vhosts for custom paths

  • riegel
  • Born
  • Born
  • riegel
  • Posts: 1
  • Loc: Rocky Mount NC

Post 3+ Months Ago

Hello all,

I have a server set up that uses vhosts and it works fine. I would like to do something that I haven't seen done before, and am wondering how it might be done.

I would like to have 2 virtual hosts that look like this...
(I realize my syntax isn't correct)

Code: [ Select ]
  ServerName myexample.com
  DocumentRoot /var/www/myexample

  ServerName myexample.com/other
  DocumentRoot /var/www/myotherexample
  1. <VirtualHost>
  2.   ServerName myexample.com
  3.   DocumentRoot /var/www/myexample
  4. </VirtualHost>
  5. <VirtualHost>
  6.   ServerName myexample.com/other
  7.   DocumentRoot /var/www/myotherexample
  8. </VirtualHost>

This is differnet than the normal scenario that might be solved by using something like (myexample.com and other.myexample.com).

I want the Virtual host to be determined by looking at the path also. I am thinking a solution will probably require mod_rewrite, but not sure how one would go about doing this.

If you are wondering why I need to do this the explanation is a little lengthy but I will attempt to answer here to try and avoid "why don't you do it this way..." type responses. I have software that I run that is licenced on a per domain level. It doesn't care about what happens after the domain. I am trying to figure out a way to use this software in a way that would allow me to seperate instances of it using virtual hosts but would not require me to get a new license for everytime I do this.

Thanks for any help or direction with this.

Terry Riegel

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 22 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.