-1
There is how to create a script, to identify all the links of a site and modify them later, ie add the code in footer.php and so it change the links. Would that be:
ANCIENT LINK: https://site.com/dwd8464
AUTOMATICALLY SWITCH TO: https://site.com/linkdireto/? a=dwd8464
Can you do ? like a link protector, but to change the link.
With the code in the footer of the site, it identifies everyone, always need to modify the posts on my site.
It would be like those scripts that adfly uses to identify links, and add their link protector.
If you are going to have all this work on a site whose PHP you have access to, it would no longer be better to change in PHP itself?
– Jefferson Quesado
You could even graft a Javascript to go through all the elements
<a>
and make this change, but it would hurt the user experience (not to mention it could open up a small gap to click on the old link)– Jefferson Quesado
the links are used in other sites, so I want to make available the javascript, to be able to put in their sites, to be able to change my linsks, to the new format, so without having to modify each post..
– Matheus Vitor
you want to change the link that third parties point to you?
– Jefferson Quesado
Yes, they use my server. Then they want to change the url parameter to the new one without having to manually modify it.
– Matheus Vitor
I believe that changing the
.htaccess
is the best solution in this case, but sincerely aCtrl + H
in a half-mouth IDE is quite simple to do than a javascript that does this– Costamilam
@Guilhermecostamilam or use a
sed
for programmatic editing of text...– Jefferson Quesado
Ai e que ta personal, /linkdireto/ and a folder that I made myself, and n can touch . htacsess, why it will be on client sites, and almost equal those scripts that adfly provides.
– Matheus Vitor
if I understand,
/linkdireto/
is a folder on your server where you have something that you make available to your clients, you can change YOUR.htacces
to redirect links in the old format to the new one, but if you’re going to make js available, make available a regex that captures old links and swaps for new ones and tells your client to use it in netbeans, vs code, I think even in the sublime to do this– Costamilam
Ai e que ta, the old links will still work! the redirect I want to do only to those who use the script.
– Matheus Vitor