Forum Moderators: phranque
I'm sure this is something very simple, that I can't see ...
My footer include file is in my includes directory ....
mydomain.com/includes/footer.html
When this file is included on any page that is 1 directory deep (like my include files are), the links in the footer menu work fine - but if they are not, the links are broken.
I am using virtual includes, which is supposed to allow you to place your include files in any directory, so why does it not work?
The include itself works fine - it's just the links that don't work
For example, a link URL in my footer file would be something like ...
"../widgets/index.html"
If this link appears on a page that is 1 directory deep, it works fine - but if it's 2 directories deep it doesn't work.
This is not surprising, since the URL should be ...
"../../widgets/index.html"
So how should the link URL appear in the footer file so that it works wherever it is used?
You need to learn about Absolute and Relative Paths [webdesign.about.com].
What you have to do in your case is make all links absolute. For example:
(First slash) --> [b]/[/b]first_dir/second_dir/filename.html