Handle url with javascript

1

I have a blog and platform migration (Blogger -> Wordpress) and I have also changed the domain. For the newer articles I do not face any problem, however articles with more than one or two years, there are links spread over the web with the old domain.

I need to manipulate the URL as follows:

When the user accesses the link, for example:

link

You receive a message saying that the blog has changed its address and a link is generated according to the URL of the active page (I prefer this than to automatically redirect the user, however, I do not rule this out):

link

The domain is different, however the URL structure is the same on both platforms.

I have read some tutorials about this with PHP, however, on Blogger I can only work with HTML and javascript.

    
asked by anonymous 04.07.2015 / 21:50

1 answer

2

Here's an example> >

<script> 
var ok = window.location.pathname; 
window.open('http://linkdowebsitenovo.com/' +ok +window.location.search, target="_self");
document.write('<center><p><h4>O Website Movido.<p>Redirecionando</p><p>Caso não seja redirecionado automáticamente </h4><h2><br><a href="" onclick="javascript:window.location="http://linkdowebsitenovo.com'+ window.location.pathname +' '+ window.location.search +'">Clique aqui.</a></p></h2></br>');
</script>

I hope it was helpful. :) [I could not know for sure what you want to do ..]

    
05.07.2015 / 00:47