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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:05:17+00:00 2026-05-25T16:05:17+00:00

so what I would like to do is have a link on an external

  • 0

so what I would like to do is have a link on an external website (example: externalsite.com) that will go to mywebsite.com/page.php, and I need to make it so ONLY clicking on the link from externalsite.com will allow you to access mywebsite.com/page.php.
The user cannot simply type it in their browser to get there, how would I go about doing this?

  • 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-25T16:05:18+00:00Added an answer on May 25, 2026 at 4:05 pm

    Given that no method is 100% secure, I’ll show you a very easy, overtly insecure method that will work in any framework because it’s pure JavaScript. Keep in mind that this is designed to work only as a general rule and is in no way “hacker proof”.

    Simply add this script to your mywebsite.com/page.php. It will redirect any request that isn’t referred by a page on externalside.com.

    var referrer = document.referrer;
    referrer = referrer.toLowerCase();
    if (referrer.indexOf("/externalsite.com") == -1) && referrer.indexOf(".externalsite.com") == -1) {
        window.location.href = "http://mysite.com/accessdenied.php"
    } else {
        document.findElementById("myBody").style.display = "block";
    }
    

    To get around the whole “if you disable JavaScript, this doesn’t work, you idiot” dilemma, add id="myBody" style="display: none;" to your page’s <body> tag: the page will not be displayed unless JavaScript is enabled and validates the referring URL. Also, I’m not an idiot.

    There are several ways to bypass this method: spoof the referring url, use FireBug to remove display: none, view the source of the page and recreate it on your local machine, etc. This method is more of a deterrent than a security feature.

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

Sidebar

Related Questions

This is a nasty one. I have an external link. <a href=http://www.example.com target=_blank> now
I have a lot of external links that is point to this http://example.com/sub-dir/post_name/2010/10/10/ and
I have a href link and I would like it to be clicked when
I have a problem that I would like have solved via a SQL query.
I have a WebView wherein I would like anchor tags with rel=external to open
I would like to develop an external website using Facebook Connect instead of an
I have a ViewPage within which I would like to specify an external style
I have several sites (Asp.Net) that I would like to have a single sign
I have a external link to my site which generates a URL like the
I would like to make a js file external for my client... for example,

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.