Redirect URL to another version of my website

Hey,

I have a website: www.aiyokish.com on which I’m planning to use as a homepage for my music. I also use this external platform called ‘Hypedit’ and they have a feature called ‘Loud Link’. This essentially embeds a player onto the page and creates another URL: https://hypeddit.com/track/uv742b

Is there a way to make it so I can publicly display www.aiyokish.com as my website, but it take users to https://hypeddit.com/track/uv742b ? I want to show the player but my original domain will look more professional on social and the net in general…

I did find a thread (Possible to redirect? - #5 by bartekkustra) whereby I tried to follow a website redirect by putting the following code into the ‘footer/before body’ section of the project settings, but that didn’t seem to have any effect (probably a stupid idea):

<script>
$(document).ready(function() {
curl = $(location).attr(‘href’);
if(curl == ‘http://aiyokish.com’ || curl == ‘http://www.aiyokish.com’ || curl == ‘www.aiyokish.com’) {
window.location.replace(‘http://hypedd.it/dmo8r8’);
}
});
</script>

Hi @Sketch,
Try this. I use this on my website to redirect users to dutch/english domain.

  <script>
    var hostName = document.location.hostname;
    if(hostName.indexOf('aiyokish') >= 0){
	  window.location.href ='‘http://hypedd.it/dmo8r8;
    }
    else{
	window.location.href ='HERE YOUR OTHER URl';
    }
    </script>

Let me know if it works out for you.

Hey, thanks for your reply

I put it ‘footer code’ in project settings and published it but didn’t work. Did I put the code in correctly and in the right place?

@Sketch Do you have a share link for me?

Oh you have an error in console…

Please try this between the script tags:

var hostName = document.location.hostname;
if(hostName.indexOf('aiyokish') >= 0){
  window.location.href ='http://hypedd.it/dmo8r8';
}
else{
window.location.href ='https://www.aiyokish.com';
}

Thank you that worked perfectly - www.aiyokish.com

There’s a very noticeable lag switching between the two pages, as well a glitch whereby the player loads up multiple versions of itself… especially on mobile where it loads of the entire screen… but I suppose this is something I should speak to with the hyppedit tech team?

1 Like

The lag on my website is 0,5 second I think… It kind of flashes on mine, it is almost not visible, but it seems on yours that it is reloading twice. I think that is a problem inthe hypedd.it.

Cause it should only redirect once… It can’t redirect again when the browser has left your page.

Ok, I guess I’ll have to go back to them - thanks for your help and quick responses, really appreciate it

1 Like

You’re welcome. Reach out to me when you have another problem :slight_smile: