The problem is, that I'm trying to find a way, to check for the project name. The default way of creating a subdomain is projectname.username.md2site.com

Right now I can try to check, if there is another project, that uses this subdomain. But the problem starts, when:

Scenario 1

  1. UserA creates ProjectA. Names it test. He gets test.username.md2site.com
  2. UserA links DomainA to ProjectA.
  3. In database, we have now ProjectA linked to DomainA
  4. UserA creates ProjectB. Names it test.
  5. Crash

Scenario 2

Unlikely, but explains the problem

  1. UserA creates ProjectsA. Links DomainA.
  2. UserA cancels DomainA at domain provider.
  3. UserB acquires DomainA.