jeudi 1 juin 2017

jQuery url is not swapped around on a web server

Okay so here's the problem.

<a>

Tag on the website has a href of

/news-features/8/news-headlines/103818/these-pupils-deserve-better

and of course the domain in the beginning let's say it is:

http://ift.tt/2qE9m6H

Therefore the whole link is

http://ift.tt/2rXu2KF

However, it should be:

http://ift.tt/2qDRXeA

So it is linked to the website information is taken from.

My JQuery function is

var base = "http://ift.tt/1o3W6zh";
$('a').each(function(index, element) {
  element.href = element.href.replace("http://ift.tt/2qEkvUZ", base);
});

Which locally works fine as it gives me the correct link however the same code on a webserver gives me:

/news-features/8/news-headlines/103818/these-pupils-deserve-better enter image description here

Now I am not sure what is the fault, is it the .htaccess and it's rewrite rule or is it something else?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire