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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:30:37+00:00 2026-06-05T23:30:37+00:00

If I have : domainA.com/out.php : <?php header(‘location: http://domainB.com/’); ?> Is it possible to

  • 0

If I have :

domainA.com/out.php :

<?php
  header('location: http://domainB.com/');
?>

Is it possible to get url : domainB.com and it’s IP Address, with domanA.com/out.php from domainC.com?

What I want :

domainA.com/index.php

<?php
   $data = getUrlandIp("domainA.com/out.php");
   echo $data[0];  # wanted output (URL) : domainB.com
   echo $data[1];  # wanted output (IP) : 133.133.133.133
?>
  • 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-05T23:30:40+00:00Added an answer on June 5, 2026 at 11:30 pm

    If you need to get all the redirects, you can do

    function getRedirectsToUri($uri)
    {
        $redirects = array();
        $http = stream_context_create();
        stream_context_set_params(
            $http,
            array(
                "notification" => function() use (&$redirects)
                {
                    if (func_get_arg(0) === STREAM_NOTIFY_REDIRECTED) {
                        $redirects[] = func_get_arg(2);
                    }
                }
            )
        );
        file_get_contents($uri, false, $http);
        return $redirects;
    }
    

    This will return an array holding all the redirects with the last entry being the final destination.

    Example (demo)

    print_r(getRedirectsToUri('http://bit.ly/VDcn'));
    

    Output

    Array ( 
        [0] => http://example.com/ 
        [1] => http://www.iana.org/domains/example/ 
    ) 
    

    You’d have to lookup the IP’s manually though (see other answers here) but note that a redirect target doesnt have to be a hostname. It can very well be an IP as well.

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

Sidebar

Related Questions

I have a site on domainA.com. It includes file.js from domainB.com: <script type=text/javascript src=http://www.domainB.com/file.js></script>
I have an url domain.com/a which redirects to domain.com/controller/action/a . How do I get
I have a PHP function which takes a passed url and creates a clean
I need a certain part of a URL extracted. Example: http://www.domain.com/blog/entry-title/?standalone=1 is the given
I have a rewrite rule: RewriteRule ^b/([^/]*)$ bus.php?location=$1 When I try to login from
I have my wordpress blog at www.mysite.com , also I have my own php
I have a website that has images with urls like this: http://mysite.com/image1.jpg My server
I have my php in /srv/www/site directory, which resolves to www.domain.com/site . How can
I have domain site.com and there is subdomain sub.site.com Once you open sub.site.com you
In google app engine can I have www.domain.com point to version X of my

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.