Code needed for redirection plus total deletion SEO correct

  • 1
  • Question
  • Updated 7 years ago
  • Answered
Hi. Have been away from Yola for while. Can someone advise following (which I should know but have forgotten, and don't seem to be able to find exactly what I am after when searching):
I have replaced content of some pages and renamed differently. HOwever, old pages still up on web. I wish to put redirection so will take to new pages. I know how to take people to other sites etc.
Would like the shld those 'old' pages need to stay up on the web before deleted completely?
At present all the 'old' designed pages are available when searching.
I do appreciate. Thanks. JC
Photo of JC

JC

  • 354 Posts
  • 15 Reply Likes
  • confident someone will help me.

Posted 7 years ago

  • 1
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi JC,

If you want your old pages to redirect to your new ones, you can use the following code. This code will make it where it will only redirect when you are on your site, so when you're in the site builder it wont redirect.

Follow these steps to install this code on your site.

Step 1. Before you do anything, make sure that at the end of the site builder URL, there isn't a "#" mark because if there is it will mess it up for the next time you login. If there is a "#", remove it out of the address bar and then press enter. (This will refresh Yola, but this is the only way the code'll work.)

Step 2. Drag over an HTML widget to the page you wish to redirect. Paste this in:


<script type="text/javascript">
if(window.top.location=="PASTE URL OF SITE BUILDER HERE") {
//do nothing in site builder
}
else {
window.location="newpage.php";
}
</script>
<noscript>
<meta http-equiv="refresh" content="1;url=newpage.php">
</noscript>


Step 3. Before you save, you'll need to copy what is in the address bar (it starts with http://sitebuilder.yola.com/, make sure you copy everything in the address bar for this to work) and then paste it into where it says "PASTE URL OF SITE BUILDER HERE".

Step 4. Change "newpage.php" to the page you want it to redirect to on both of the parts of the code. (The second one is for users without JavaScript)

Step 5. That's it! Now just click Save to close the HTML widget and then Save the page.

Please Note: It will also not redirect in the preview. It will only take affect on your published site.

By the way, when you delete a page, it will eventually be taken off of Google because when Google re-indexes websites, it will see that it gets a 404 and take it off.

Hope this helps.

Kind regards,
Nathan