Link to Page not working.

For requests for help from CG administrators, Wranglers, and experienced CG members. Please read the FAQ before posting. Also look at CG Wiki for tutorials and how-tos written by other CG webtoonists.
Post Reply
Caster13
Regular Poster
Posts: 398
Joined: Fri Jan 01, 1999 4:00 pm
Location: Missisauga, Ontario, Canada
Contact:

Post by Caster13 »

Can it either be with the forward slash ( a href="/cast.html" ) or without the slash ( a href="cast.html" ) ?<P>-Caster13<p>[This message has been edited by Caster13 (edited 08-15-2000).]

Caster13
Regular Poster
Posts: 398
Joined: Fri Jan 01, 1999 4:00 pm
Location: Missisauga, Ontario, Canada
Contact:

Post by Caster13 »

Anyway, I tried pretty much every every possible link thingy and it still doesn't work.<P>I have cast.html in /workspace/webpages/ but it gives me a 404 Page not found error.<P>-Caster<P>------------------

Josh Phillips
Regular Poster
Posts: 40
Joined: Fri Jan 01, 1999 4:00 pm
Location: Kingston, Ontario, Canada
Contact:

Post by Josh Phillips »

Here's the long version...<P>You have a <B>public_html</B> directory (I assume). Everything you see on the web is relative to that directory. For example, <B>public_html/index.html</B> gives you <B>http://www.foo.com/index.html</B>. And <B>public_html/links/index.html</B> gives you <B>http://www.foo.com/links/index.html</B>.<P>Now, there are two different types of links in a web page: <I>absolute</I> and <I>relative</I>. They mean exactly what your dictionary tells you... ;-) That is, an absolute link is something like <B>http://www.foo.com/index.html</B>. Notice all the <B>http://...</B> stuff; since you have all that web mumbo-jumbo there, that link will work no matter where you are on the web.<P>Now, <I>relative</I> linking is a different beast... it means that the link goes somewhere based upon where you already are. A relative link only consists of something like <B>bar.html</B>. If you're looking at <B>http://www.foo.com/index.html</B> and you click that link, you'll go to <B>http://www.foo.com/bar.html</B>. If you're at <B>http://www.foo.com/links/index.html</B> and click the link, you'll go to <B>http://www.foo.com/links/bar.html</B>. So really, your browser fills in the <B>http://...</B> for you. Of course, the big problem here is that you <I>must</I> know where you are in a site before you link from it to use relative linking properly.<P>Now, here's one more little trick. I think this is relative linking, but I can't be sure... if you put a slash before your relative link (ie. <B>/bar.html</B>), that means <I>it's relative to <B>public_html</B></I>. So no matter where you are in your site, clicking on <B>/bar.html</B> will go to <B>http://www.foo.com/bar.html</B>. Clicking on <B>/links/bar.html</B> goes to <B>http://www.foo.com/links/bar.html</B>.<P>Now, does any of that make sense? :-) As you may have noticed, relative linking is nice if you change domain names at some point... simply because you're not hard-coding a domain name into your links. The domain is pasted in automatically by the web browser.<P>And I always recommend using that semi-relative form (with the slash in front), because then you can just copy and paste menu bars and blocks of links, and they'll work no matter what page they're in (they're all just relative to the base <B>public_html</B> directory).<P>And as a final note... always use forward slashes ("<B>/</B>")in HTML! Don't use backslashes ("<B></B>").<P>JOSH.
<P>------------------
Josh Phillips - <A HREF="mailto:josh@avalonhigh.com">josh@avalonhigh.com</A>
Avalon - <A HREF="http://www.avalonhigh.com" TARGET=_blank>http://www.avalonhigh.com</A>

Tirdun
Regular Poster
Posts: 684
Joined: Fri Jan 01, 1999 4:00 pm
Location: MD, USA
Contact:

Post by Tirdun »

And always be case sensitive, although some systems don't care, it's a good idea to always use lowercase, with no special characters. After you've beaten your head into a desk for half an hour trying to figure out why Newpage.html won't load, you'll understand.<P>------------------
Brian West
aka Tirdun
tirdun at yahoo dot com
farawaystars.keenspace.com
- There is no spoon -

Caster13
Regular Poster
Posts: 398
Joined: Fri Jan 01, 1999 4:00 pm
Location: Missisauga, Ontario, Canada
Contact:

Post by Caster13 »

Woot!<P>Thanks for the info! It's somewhat confusing in itself but after reading it through a couple of times it actually makes some sense.<P>Though I haven't updated yet so I can't tell whether or not it's working.<P>Thanks!<P>-Caster<P>------------------
Proud owner of "What/s A Life".
Viewable at <A HREF="http://whatsalife.keenspace.com" TARGET=_blank>whatsalife.keenspace.com</A>
Please visit.

Josh Phillips
Regular Poster
Posts: 40
Joined: Fri Jan 01, 1999 4:00 pm
Location: Kingston, Ontario, Canada
Contact:

Post by Josh Phillips »

Also, don't use spaces in your filenames. That's one of those annoying things that work in IE but not Netscape, so you could be screwing over a bunch of readers and not even realize it.<P>Hey, I never knew about this newsgroup before. Cool. :-) If anyone needs any HTML help (or JavaScript, or CGI/Perl, or Java, or Intel-x86/Z80 Assembly, etc.) you can e-mail me. I always enjoy helping people get past stupid HTML annoyances...<P>But all this Keenspace-specific infrastructure is weird. :-/ Your system frightens and confuses me...<P>(UNFROZEN CAVEMAN LAWYER!)<P>JOSH.
<P>------------------
Josh Phillips - <A HREF="mailto:josh@avalonhigh.com">josh@avalonhigh.com</A>
Avalon - <A HREF="http://www.avalonhigh.com" TARGET=_blank>http://www.avalonhigh.com</A>

Caster13
Regular Poster
Posts: 398
Joined: Fri Jan 01, 1999 4:00 pm
Location: Missisauga, Ontario, Canada
Contact:

Post by Caster13 »

Woot! Got it working! After all this time!<P>You know what I did wrong? I did a index.html update instead of a FULL update... Oh dummy me.<P>Go check it out. My cast page is up, you wont see any comics but you'll see who's in them.<P>-Caster<P>------------------
Proud owner of "What/s A Life".
Viewable at <A HREF="http://whatsalife.keenspace.com" TARGET=_blank>whatsalife.keenspace.com</A>
Please visit.

Caster13
Regular Poster
Posts: 398
Joined: Fri Jan 01, 1999 4:00 pm
Location: Missisauga, Ontario, Canada
Contact:

Post by Caster13 »

Okay, I'm having a problem here. I can't seem to link my index page to my cast of characters page.<P>I have cast.html in workspace/webpages/<P>Okay, in my indextemplate.html file I have the link:<P>a href="/workspace/webpages/cast.html"> Cast of Characters </a<P>
But that code doesn't work and it leads to some empty page.<P>How is the link suppose to be?
a href="/workspace/webpages/cast.html
a href ="/webpages/cast.html
or
a href="cast.html<P>Any help would be great about now. Thanks.<P>
-Caster<P>
Edit: Fixed the coding (in this message).<P>------------------<P>
[This message has been edited by Caster13 (edited 08-15-2000).]<p>[This message has been edited by Caster13 (edited 08-15-2000).]

Morten B. Helland
Regular Poster
Posts: 86
Joined: Fri Jan 01, 1999 4:00 pm
Contact:

Post by Morten B. Helland »

The code in the HTML should just be the document-relative-link <a href="cast.html">Cast Of Characters</a> or the server-relative-link <a href="/cast.html">Cast Of Characters</a> since the stuff in the workspace/webpages-folder get moved to the root of the public-html-folder.<P>------------------
Stripped Again - a comic strip by Morten B. Helland - The Keenspace Division
<A HREF="http://strippedagain.keenspace.com/" TARGET=_blank>http://strippedagain.keenspace.com/</A> <p>[This message has been edited by Morten B. Helland (edited 08-15-2000).]

User avatar
Toxic
Faster Pussycat
Posts: 4163
Joined: Mon Jul 15, 2002 5:43 pm
Location: Los Angeles, CA

Post by Toxic »

i think its case sensitive here b/c once i linked my cast pages as /cast.html but it was named Cast.html and it didn't work

ZOMBIE USER 10799
Regular Poster
Posts: 371
Joined: Sun Feb 27, 2005 2:26 am

Post by ZOMBIE USER 10799 »

yes it should be /cast.html
i made that mistake myself, before Atrus corrected me }:) always assume that you're using Unix or some case sensitive platform and you won't regret it
also make sure you use .html consistantly instead of .htm sometimes
finally don't use full update unless all else fails, usually a REGULAR update works beautifully, just remember getting out of the waiting queue can sometimes take up to an hour and a half

Post Reply