Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

81
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda