Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Vanity Subdomain for SaaS Web app instances

Vanity Subdomain for SaaS Web app instances

Vanity Subdomain for SaaS Web app instances

Hey, Guys (not sure if this is the correct board to post this in, but I'll let you decide that), I'm wanting to produce a web app with vanity subdomains for different user's sessions. Similar to how zendesk works. i.e. YourCompany.MyApp.com, would somehow reference that user's databases for their session of the app. Is there a simple way to do this, or is it better just to stick with one big instance for the totality of the users?

RE: Vanity Subdomain for SaaS Web app instances

Its probably simple, but has nothing to do with PHP.

Subdomains are the sole control of the webserver not PHP. You would need use a server job/script outside of PHP, that generates such subdomains in the webserver's configuration file and points them to whatever it is you want to point them to and restarts the webserver to apply the changes everytime someone signs up to your app.

Alternatively, you can have your actual domain respond to all subdomains by editing the , and then have PHP serve the appropriate content based on what subdomain was requested.
See here: https://stackoverflow.com/questions/17706904/how-t...

Phil AKA Vacunita
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: Vanity Subdomain for SaaS Web app instances

Sessions are per user anyway, any request is that of a single user in $_SESSION and has only that users session data and LocalStore and whatever you use clientside.

Quote (TGraham)

one big instance for the totality of the users?

Not sure what you're talking about. You can have several web apps on the same domain subdomains are one way to separate that, but not necessary. You're in full control where you ask for separate logins and even if the same user should be able to use several web apps, it's up to you how many sessions you start, the session management regarding PHPs $_SESSION, see session_id() and /or session_name().

The role of browsers is to store cookies per domain/subdomain, but you can have separation without using subdomains, you can store session info server side or client side, just look a bit deeper into PHPs session functions what you can do. You're not forced to use session_start(); parameterless and have only one session for the user for the whole site. It's really up to you.

Bye, Olaf.

Olaf Doschke Software Engineering

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close