0

Hy,

I have 3 apps that I have to make them work without interfering with each other.I'm working on an application where the clients (after registration) can have a subdomain.For this I'm using dns wildcards

The flow is:

  1. I have the company website on xxx.de (wp presentation website) - First virtual host

...... ServerName xxx.de .....

  1. The user registers himself on the main company website. After registration a new DB entry is created on the second app (zend app - the one with the subdomains) .. basically creating the user's profile and saving in DB hist profile subdomain: client1.xxx.de , client2.xxx.de etc ...

.... ServerName *.xxx.de ....

  1. On any request .. in the code I'm checking if there is an existing DB entry for the requested URL subdomain .. if yes then I'm displaying his profile subdomain ... if not then I;m redirecting to the main xxx.de website.

  2. On the same server I also have a testing version of another app using the same domain name testingapp2.xxx.de

.... ServerName testingapp2.xxx.de ....

:) you've guessed it ... because of the second app now the third is not working , because on the second app I'm allways checking in DB if there is a client matching the requested subdomain and redirected to the main company website.

What would be the solution for making all 3 or more apps work together ?

Thanks

Claudiu
  • 1
  • 1

2 Answers2

0

You may just need to consider the order that you are applying your URL rules. If you create a list of special case subdomains, you should check for those before you check for user ids.

Checking for your user ids (wildcard) should be the default option. Sort of like this pseudocode:

if ((URL.startsWith(xxx.de) || URL.startsWith(www.xxx.de))
 serve wp_presentation_website 
else if (URL.startsWith(testingapp2.xxx.de)) // you can add more of these
 serve testingapp2
else serve client_profile // if this fails, it should still redirect home

I'm not totally sure where you are checking or what language you are using, so hopefully this applies. If it's something like an .htaccess list, just explicitly set the paths for your "special apps" before you set the wildcard.

Hope that helps!

NickT
  • 214
  • 1
  • 5
0

Hy,

Not working I think the solution is on the server side by configuring the apache vhosts but still didn't figure it out :(

UPDATE:

One solution is to force apache to read first testingapp2.xxx.de virtual host by reanaming the vhost file from:

testingapp2.xxx.de to 0testingapp2.xxx.de

Is there any other solution ? .. this seems just a hack

Claudiu
  • 1
  • 1