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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:47:01+00:00 2026-06-12T05:47:01+00:00

I found an nice script while searching and inspecting the elements of some websites.

  • 0

I found an nice script while searching and inspecting the elements of some websites.

This is what I have found:

<script type="text/javascript">
//redirect browser to fullscreen preview
    if (/^http:\/\/codecanyon\.net/.test(document.referrer))
    window.top.location.href = 'http://www.gravitysign.com/backslider/';                    
</script>

So if I understood from this script it tells jquery if the website is opened over codecanyon redirect them to specifed website for preview.

Now… I was wondering if there is possibility to make something like this.

If we specify an website for example http://google.com and we input that into javascript… And then if that website is uploaded to any other domain, other then google.com … It will redirect to specified site (google) ?

So to clear things out a little bit let me make an example.

If I made a website for “an-website.com” and then someone take their website and upload it to “another-website.com”, it will automatically redirect all visitors from another-website.com to an-website.com.

Hope I was clear enough and hope that this is possible. Cheers!

  • 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-12T05:47:02+00:00Added an answer on June 12, 2026 at 5:47 am

    You can of course redirect any user accessing your site from a domain not matching yours but using javascript. This should work just fine:

    if (window.location.hostname !== 'yourdomain.com'){
        window.top.location.href = 'http://yourdomain.com'; 
    }
    

    You can also use match, if you host your site on a subdomain, etc.

    Keep in mind that any person with write access to the file on the server will be able to remove this “copy protection”. Copy protecting client side content is impossible, as you need to serve the content in a way a browser understands, effectively making the content available to anyone.

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

Sidebar

Related Questions

I have this nifty little script that does a nice job of manipulating some
I found a nice bit of code to add some 'normal' text links (i.e.
I found this nice email protector script from css-tricks.com (link) Here is the code:
I'm new to JavaScript. Found nice calendar script, but without month switch buttons. I
Haven't found a solution to this problem yet, have tried some things... I have
I found a nice script for dropdowns. The thing is, I'm trying to have
I have found a nice jquery increment script. The increment portion can accept a
I found a nice script to import xml using powershell http://slash4.de/tutorials/Automatic_mediawiki_page_import_powershell_script Currently I don't
I'm writing a JavaScript application, and I found a nice library qtip2 . My
I found a nice little script on snippr( http://snipplr.com/view.php?codeview&id=799 ) that gives me the

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.