2
I’m creating a website... So far so good.
I 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
pull all links from the site root.
Ex: Before my site pulled an image with the name
imagem.png
in the caseimagens/imagem.png
, more after changing my URL, now I have to use../../imagens/imagem.png
because if you don’t do this in the images for example, it will give all error 404.
Is there any way to make it change the directory url automatically without me 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 on all images via PHP
?
Site root you refer to the initial Apache directory?
– gmsantos