Forum Moderators: phranque

Message Too Old, No Replies

Broken Links in SSI

can't figure it

         

Tiebreaker

4:27 pm on Oct 29, 2004 (gmt 0)

10+ Year Member



Hi

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?

moltar

4:42 pm on Oct 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firstly, this has nothing to do with perl.

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

Tiebreaker

3:34 pm on Oct 30, 2004 (gmt 0)

10+ Year Member



Thanks

I've got those absolute links figured out now - it turns out it was working all along, once it was on the server - it just didn't work right in Dreamweaver preview mode.