I'm creating a website ... So far so good.
I've created friendly URLs.
Before my URL was something like:
localhost/site/produto.php
And now it's:
localhost/site/produtos/produto/planos
I wanted a code PHP
to pull all links from the root of the site.
Ex: Before my site pulled an image with the name
imagem.png
in theimagens/imagem.png
case, but after changing my URL, I now have to use../../imagens/imagem.png
because if it does not do this in the images for example, it will give all Error 404 .
Is there a way to make it change the url of the directory automatically without having to edit one by one?
In case it would be:
href="http://<?php echo $_SERVER['SERVER_NAME']; ?>/imagens/imagem.png"
Now comes the problem: How to put the code above <?php echo $_SERVER['SERVER_NAME']; ?>
automatically in all images via PHP
?