how to do a java script redirect

redballlizard

Junior Member
Joined
Jun 11, 2016
Messages
191
Reaction score
2
I want to do a redirect that reads the page in the google cache but redirects to a landing page. I think java script can do that but I can't seem to find the javascript code to put in the index.html to make this work.
 
Why don't you use html?
Code:
<meta http-equiv="refresh" content="0;http://anotherdomain.com">

Or if you really need javascript:

Code:
<script language=javascript>
function redirect(){
  window.location = "http://REDIRECTURL.com";
}
</script>

<body onload="redirect()">

</body>
 
thanks man html may cache both sites. I want the main site to be cached
 
I was going to redirect it to the landing page for the niche im targeting thinking that the landing page has the highest conversion rate is that the wrong way to look at it?
 
that what i understood from you message
You want to encrypt your code javascript i will show you how

this page will redirect youto google after 3 Sec
<html>
<head>
<script>
function gotoX(){
window.location = "www[dot]google[dot]com";
}

setInterval(gotoX, 3000);
</script>
</head>
<body>
</body>
</html>

Now lets encrypt our code
you can use javascriptobfuscator[dot]com
put the js code then click on obfuscate button copy the result to your page html
it's will be like this

<html>
<head>
<script>
var _0x89de=["\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x67\x6F\x6F\x67\x6C\x65\x2E\x63\x6F\x6D"];function gotoX(){window[_0x89de[0]]= _0x89de[1]}setInterval(gotoX,3000)
</script>
</head>
<body>
</body>
</html>

Sorry for my bad english ;)
 
Back
Top