Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

79
Views
Change website when redirecting from another page

I have a main page that redirects to another page called example.com

the code of the main page is:

 <! DOCTYPE html>
 <html>
 <body>

 <h2> Redirect to a Webpage </h2>
 <p> The replace () method replaces the current document with a new one: </p>

 <button onclick = "myFunction ()"> Replace document </button>

 <script>
 function myFunction () {
   location.replace ("https://www.example.com")
 }
 </script>

 </body>
 </html>

example.com shows "Original Webpage" if you enter directly the code for example.com is:

 <! DOCTYPE html>
 <html>
 <body>

 <h2> Original Webpage </h2>
 </body>
 </html>

I want that when redirecting from the main page to example.com, example.com shows "modified page". then you should change <h2> Original Webpage </h2> from main page before entering example.com

! I don't own example.com !

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

you cant change other sites' content. If it would possible, someone could redirect user to (for example) Amazon, changing its code to hijack login/password or credit card info.

Browsers have special checks to insure content of the site in address bar is genuine

about 4 years ago · Juan Pablo Isaza Report

0

Considering you own example.com.

The redirecting url could include a parameter:

location.replace("https://www.example.com/?redirected=true")

On example.com you could check if that parameter exists:

if (new URL(location.href).searchParams.get('redirected')) == 'true') {
  document.querySelector('h2').textContent = "modified page"
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!