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 9028835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:05:51+00:00 2026-06-16T07:05:51+00:00

I have 5 domains which are re-directed to a single hosting. I am using

  • 0

I have 5 domains which are re-directed to a single hosting. I am using Joomla on the website having an issue with banner. I want that if someone redirected from domain1 the hosting site shows banner for domain1, domain2 banner2 and so on.

What would be the best methodology whether in Joomla or Core PHP?

  • 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-06-16T07:05:54+00:00Added an answer on June 16, 2026 at 7:05 am

    You need to use 'HTTP_REFERER' in PHP’s $_SERVER superglobal. Read the manual for more information.

    Basically, HTTP_REFERER contains the URI of the site that was directed to your host. It’s not guaranteed to actually contain a value, but it’s your best bet without involving GET variables issued in the URL. Note: you will have to parse out the domain name before you can use it.

    The manual has this to say…

    The address of the page (if any) which referred the user agent to the
    current page. This is set by the user agent. Not all user agents will
    set this, and some provide the ability to modify HTTP_REFERER as a
    feature. In short, it cannot really be trusted.

    Your code might look like this…

    function GetBannerForDomain() {
        $url_array = parse_url($_SERVER['HTTP_REFERER']);
        switch (str_replace("www.", "", $url_array['host')) {
            case 'example.com':
                $img_src = 'path/to/banner.png';
            default:
                $img_src = 'path/to/default/banner.png';
        }
    
        return $img_src;
    }
    

    If you have any control over the re-directing domains, you could fall back to using GET vars in the redirect, like so…

    http://www.yoursite.com/referer/site1.com
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two domains that point to the same IP, which is an Ubuntu
I have 2 Domains which i want to forward. Example http://www.domain.com http://doma.in I want
I have two domains, domain1.com and domain2.com pointing at the same asp.net website which
I have a couple of domains which i want to shere sessions. I have
I have two domains which point to the same root and I want to
I have to write a script which will be hosted on differents domains. This
I have a multilingual WordPress site using WPML plugin which allows to have separate
I'm building a website with Rails which can let user check if some domains
I have a list of emails and domains which I am trying to filter
I have text file that is used to store a list of banned domains

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.