Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 521107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:12:56+00:00 2026-05-13T08:12:56+00:00

I have a webapp where users can create their account and use the service.

  • 0

I have a webapp where users can create their account and use the service. Now I want to give them a custom domain facility where
app.customer1web.com points_to myservice.com with userid customer1
once he sets up the custom domain, for the world it looks like my service is running on his machine.
Many services like blogger, wp.com, tumblr give
this feature.

how do i do that?
I am using java to write my web app.
How do i map domain name to userid when request comes in?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:12:56+00:00Added an answer on May 13, 2026 at 8:12 am

    How do i map domain name to userid when request comes in?

    Obviously, you’ll have to store that information somewhere, most likely in a database.

    1. Add a database table domains with columns:

      • customerId
      • name
      • active (1 or NULL)
      • challenge

      Add unique key for (name, active) to ensure a domain name is mapped only once.

    2. When a customer attempts to add a domain, add a row with active=NULL and challenge set to a random string.

      Show the random string to the customer and ask them to put up a web page with it on the site or create a dummy DNS record with it to verify domain ownership (this is how Google Apps do it).

      You could verify ownership by sending an email to the administrative contact or in some other way.

    3. When the customer says he did what you instructed them to do in step #2, verify it and set active=1, challenge=NULL.

      If the domain was previously active for some other customer, delete those records or set active=0.

    4. Ask the customer to add a CNAME record for their domain and forward it to your domain, e.g. hosted.myservice.com (Google uses ghs.google.com for Google Apps).

    5. When a request comes in, do

      SELECT customerId FROM domains WHERE name=:requestDomain AND active=1
      

    A better way may be to automatically offer your customers a domain in the format of <customername>.myservice.com, in addition to custom domains. This gives you two benefits:

    • Customers who don’t wan’t to use their own domain can still customize their login page, e.g. with a company logo.

    • For custom domains, you can ask your customer to forward them to <customername>.myservice.com instead of to a generic hosted.myservice.com.

      This enables you to horizontally partition customers among multiple servers without having to ask customers to change anything on their end. For example, you could give customers an option to choose whether they want their account hosted in EU or US. When they change it, just transfer their data and update <customername>.myservice.com. Their custom domain will work automatically.

    To do this, you’d have to set up a wildcard DNS record for *.myservice.com (unless you also need the latter feature, in which case you’ll have to manage individual records).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web app that only registered users can use, therefore I should
I want to create a website/webapp to aid users in making translations of foreign
I have a web app where people can create custom content on the web
I'm building a webapp that manages certain types of events for users. I want
I have an existing web app that allows users to rate items based on
I have an img tag in my webapp that uses the onload handler to
Background I have a page on my ASP.NET MVC web app for users to
I have an asp.net update web app. Users go the the page, hit the
I have a webapp development problem that I've developed one solution for, but am
I have a webapp that I am in the middle of doing some load/performance

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.