# PHP keep included links intact

**URL:** <https://forum.kirupa.com/t/php-keep-included-links-intact/216784>\
**Category:** programming\
**Created:** [February 20, 2007, 3:15pm UTC](https://forum.kirupa.com/t/php-keep-included-links-intact/216784 "2007-02-20T15:15:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unchew](https://avatars.discourse-cdn.com/v4/letter/u/7ba0ec/32.png) [@unchew](https://forum.kirupa.com/u/unchew)\
**Post date:** [February 20, 2007, 3:15pm UTC](https://forum.kirupa.com/t/php-keep-included-links-intact/216784/1 "2007-02-20T15:15:55Z")

</div>

Hi, I’m making a web page that will consist in various included php files (header, menu, footer, etc). The problem arrives when I move up or down in the directory levels.

Let’s imagine my footer.php file has an image who’s path is “/imgs/footer.gif”. When I include the file into a file that is in the same directory(root), the image path works ok, but then when I include it in a page that is in a folder like “root/areas” the image link will not work now because when inserted it will search the image in root/areas/imgs/footer.gif instead of root/imgs/footer.gif.

Then, does someone has a work around on this issue? Some code, method or tutorial? Anything is welcomed.
