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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:56:34+00:00 2026-06-05T05:56:34+00:00

How can I redirect a user to an external site while linking to an

  • 0

How can I redirect a user to an external site while linking to an internal page ?

I have seen examples like:

  • example.com/go/ksdjfksjdhfls
  • example.com/?go=http://www.new-example.com
  • … And many more…

How this is achieved in php ?

Does this have any pros/cons with regards to SEO ?

  • 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-05T05:56:36+00:00Added an answer on June 5, 2026 at 5:56 am

    I don’t see any benefit in this approach, but there are a few ways to achieve it. To do it with the GET query, you would simply need the following code:

    HTML:

      <a href="http://example.com/link.php?site=http://www.google.com">Google!</a>
    

    PHP:

    if (filter_var($_GET['site'], FILTER_VALIDATE_URL)) {
              header('Location: ' . $_GET['site']);
    }
    

    With the above example, it will actually take the user to that location, not to:

     http://example.com/link.php?site=http://www.google.com
    

    To achieve the url being “local” while pulling up a remote site, you’d either have to:

    • Mess with URL rewriting, which can get messy and I’m not sure will let you do the above
    • Retrieve the remote page via curl and display it, which may screw up links on the “remote” page
    • Use iframes and set the iframe to be the size of the page. Note that this last method, while least offensive, is recognized as a potential security breach known as ‘clickjacking’ since it’s used to trick users into clicking on a link for one page which his hiding a malicious link to another site. Many servers and browsers are taking steps to avoid this (for instance, google does not allow iframing of its home page), so this may also reach dead ends.

    So of the three server-side methods I can think up, one may or may not be possible, and is a pain. One will be crippled and put a heavy load on the server. The last is a known bad guy and is likely not to work for many cases.

    So I’d just go with a redirect, and really, if you don’t need the address bar to show the local URL, then I’d just have a direct link.

    All of the raises the question: What are you hoping to accomplish?

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

Sidebar

Related Questions

My objective is to redirect the user to an external site and have them
can I have a question about how to redirect the page after user invite
How can I redirect a user to home page? Example: mywebsite.example/ddfdf/fdfdsf and I want
my situation is something like that i have to redirect user to paypal site
I would like to know how I can redirect to a certain page (during
how can i redirect to a page from sharepoint? i have this within the
How can I redirect the user to the same poll page instead of the
I have the following page that a user can go to by where this
How can I redirect the user from one page to another using jQuery or
I would like to have a user redirected to an external credit card gate.

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.