0
Like, my site has several posts and such, I would like all links of my own site to be with ? ref=app at the end.. even if I changed the page he kept the parameter.
Is there a code? a way to do this ?
0
Like, my site has several posts and such, I would like all links of my own site to be with ? ref=app at the end.. even if I changed the page he kept the parameter.
Is there a code? a way to do this ?
1
You can use rum script to capture your URL and edit it for the new reference.
<script type="text/javascript">
// PROTETOR DE LINK
(() => {
const urlsBases = ["seusite.com", "localhost"];
for (let urlBase of urlsBases) {
const anchors = document.querySelectorAll("a[href*='" + urlBase + "']");
anchors.forEach(el => {
let urlProtegida = el.getAttribute("href") + "?ref=app"
el.setAttribute("href", urlProtegida)
console.log(urlProtegida)
});
}
})();
</script>
That is, he took his main domain and added the reference: ? ref=app at the end.
Very good! thanks man.
Browser other questions tagged php javascript html
You are not signed in. Login or sign up in order to post.
Research this related to htaccess, it might help you
– hugocsl
Could you be more objective in the question? Clarify some points of how you are doing?
– Cedric S.
Like, my site I want to open inside an App, and I want when it opens inside an app to have all the url of it with the ref=app, so I’ll know that and by the app and edit the theme as I want so pro app
– Matheus Vitor