how can i add redirection script to my site

  • 1
  • Question
  • Updated 8 years ago
  • Answered
How can i add a redirection script to my site?
Photo of YorkshireNerd

YorkshireNerd

  • 56 Posts
  • 0 Reply Likes

Posted 10 years ago

  • 1
Photo of Marije

Marije, Official Rep

  • 4636 Posts
  • 237 Reply Likes
Hi Perko,

Are you looking to add some code to your page that automatically redirects the page to another URL? You can do this by adding the following HTML to your page:

1. Create a new page with the name of the site you want to link to.
2. Drag and drop a HTML widget onto your page.
3. Paste this tag into the HTML editor:
<!-- <meta http-equiv="refresh" content="2; url=http://webdesign.about.com"> -->

"2" is how many seconds it waits before it redirects - you can change this number
"url" is the URL it redirects to, so, replace the URL in the above tag with the one for the site you want to link to.
Please ignore <!-- and --> they are there to stop the code from being interpreted in this post.
Photo of Jon Dawson

Jon Dawson

  • 1 Post
  • 0 Reply Likes
Make sure you are completely done editing the page you are putting this code into. Since there is a 2 second delay, I wanted to change the banner picture. So, I went to edit that page and the script took me to the redirect url from the synthasite editor.
Photo of johnywhy

johnywhy

  • 34 Posts
  • 0 Reply Likes
here's another way to do it:


<script language="javascript">

window.location="http://target_site.htm";

</script>


the problem is, the script is executed by the editor, and so the editor gets redirected, so there's no way to save the page!

is there a way to prevent script from getting executed by the editor?
Photo of jon

jon

  • 1 Post
  • 0 Reply Likes
Looks like something for the suggestion box.
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello johnywhy

Unfortunately, there is not a way to prevent the script from executing. Perhaps you may want to considered using script provided above as it does not seem to execute as fast giving you time to save it:

<meta http-equiv="refresh" content="2; url=http://webdesign.about.com&quot;&gt;

Alternatively, perhaps you could use a timed delay script? If you're interested in this, here's the code:

<html>
<head>
<script type="text/javascript">
<!--
function delayer(){
window.location = "../javascriptredirect.php"
}
//-->
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect, please update your bookmarks to our new
location!</p>

</body>
</html>

Replace ".../javascriptredirect.php" with your URL you want to redirect to.

I hope this helps.