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

  • Home
  • SEARCH
  • 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 6333679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:30:43+00:00 2026-05-24T18:30:43+00:00

If I have multiple domain entry points and want to use the same hosting,

  • 0

If I have multiple domain entry points and want to use the same hosting, can I detect by way of PHP or JavaScript what domain that person came though to the hosting website?

ie: I have 3 domains:

  • http://www.jackfrost.com

  • http://www.holycow.com

  • http://www.ohmy.com

Hosting is under http://www.jackfrost.com.

So if somebody comes in through http://www.ohmy.com, can I detect that, so I only display content for that entry and different content for a different entry?

(purpose is to keep costs down since the websites are hosted by godaddy)

  • 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-24T18:30:45+00:00Added an answer on May 24, 2026 at 6:30 pm

    The best way you can do is to have a look at $_SERVER['HTTP_HOST'] in your PHP script and dispatch your content based on that.

    In JavaScript, you can check window.location.hostname for the domain name used.

    However, a better way would be to have three different virtual hosts in your webserver configuration – one for each domain you have. This way, even without PHP or any other scripting language, you can have different content for different domains. When using Apache as webserver, you can have a look at the documentation with examples: http://httpd.apache.org/docs/2.2/vhosts/examples.html.

    If you do not want or can use name based virtual hosting, you can use only one virtual host, and use mod_rewrite of Apache to internally rewrite requests to other directories based on HTTP_HOST.

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

Sidebar

Related Questions

I use lunarpages for my hosting, and can have multiple websites added on. When
Following is the scenario. I have something called as Domain which can have multiple
I have a single Rails 2.2.2 app that I want to 'share' with multiple
When having multiple domain names point to the same server. But you only have
I have a textarea where I can type in multiple domain names to check
I've got a class called Domain. Each Domain can have multiple sub-domains (of the
I want to create a voting system, where multiple domain objects can be voted
On IIS 6, is it possible to have multiple domain names pointing to the
We have multiple MFC apps, which use CMutex( false, blah ), where blah allows
I have multiple classes that all derive from a base class, now some of

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.