View Full Version : Paths and Links
Stecyk
06-11-2005, 11:52 AM
Hi,
I have some very simple questions.
1) I understand how to make a link to an immediate subdirectory.
<a href="/blog/">Blog</a>
I understand how to keep going "deeper."
But how do I go "UP" one or two or more levels?
I think I add ../ for each level? Is there a way to easily specify my www or root directory using a relative path?
2) Which is better, a relative or absolute path? Does it make any difference to Google?
Like I mentioned, very elementary questions.
Thank you.
Kevin
Wassercrats
06-11-2005, 12:37 PM
1) I understand how to make a link to an immediate subdirectory.
Code:
<a href="/blog/">Blog</a>I think you'd make a link to an immediate subdirectory with "./blog/" or "blog/" or "./blog/file.html" or "blog/file.html". A leading slash like you used would make the link relative to your www directoy, which is what you asked how to do.
Here are some examples from http://www.ietf.org/rfc/rfc2396.txtC. Examples of Resolving Relative URI References
Within an object with a well-defined base URI of
http://a/b/c/d;p?q
the relative URI would be resolved as follows:
C.1. Normal Examples
g:h = g:h
g = http://a/b/c/g
./g = http://a/b/c/g
g/ = http://a/b/c/g/
/g = http://a/g
//g = http://g
?y = http://a/b/c/?y
g?y = http://a/b/c/g?y
#s = (current document)#s
g#s = http://a/b/c/g#s
g?y#s = http://a/b/c/g?y#s
;x = http://a/b/c/;x
g;x = http://a/b/c/g;x
g;x?y#s = http://a/b/c/g;x?y#s
. = http://a/b/c/
./ = http://a/b/c/
.. = http://a/b/
../ = http://a/b/
../g = http://a/b/g
../.. = http://a/
../../ = http://a/
../../g = http://a/g
Stecyk
06-11-2005, 02:04 PM
Hi Wassercrats,
A leading slash like you used would make the link relative to your www directoy, which is what you asked how to do.
Ok, interesting. I lucked out. :yeah:
Thank you for the tutorial!
Best regards,
Kevin
Stecyk
07-23-2005, 07:25 PM
Hi,
I have another question.
Let's say I am fileA.php which is located...
www/blog/fileA.php
In fileA.php I want to reference fileB.php located:
cgi-bin/zowy/fileB.php
Given our file structure, am I able to use a relative reference to access fileB.php?
Or must I use an absolute reference such as the following?
http://www.mysite/com/cgi-bin/zowy/fileB.php
The reason for asking this question is that it appears (to me when viewing the file structure with my ftp client) that the cgi-bin is not "underneath" the www folder. So I can't (I don't think) simply use
/cgi-bin/zowy/fileB.php?
Or can I?
I am about to install the beta MT 3.2 and I want to be sure I lessen my errors before I begin.
I look forward to your answer.
Best regards,
Kevin
Juan G
07-23-2005, 08:15 PM
2) Which is better, a relative or absolute path? Does it make any difference to Google?
Both work fine, but for GoogleGuy (from Google, see his post (http://www.webmasterworld.com/forum30/29720.htm) of 8:26 am on June 2, 2005) absolute links are better, after choosing whether all or none of them will include the "www" part (any of the two possibilities, but being consistent).
Stecyk
07-23-2005, 08:32 PM
Juan G.,
Thank you for your answer. Unfortunately, the link you provided is to a subscription site, so I can't see the answer provided by the Googleguy. But your information is helpful.
Best regards,
Kevin
Juan G
07-23-2005, 08:50 PM
That WebmasterWorld thread can be seen with the free registration, given that it's not included in the supporters forum (paid subscription).
The reason for asking this question is that it appears (to me when viewing the file structure with my ftp client) that the cgi-bin is not "underneath" the www folder. So I can't (I don't think) simply use
/cgi-bin/zowy/fileB.php?
Or can I?You can (http://www.aota.net/forums/showthread.php?postid=123423#post123423). The directory is aliased (actually, scriptaliased, which is why everything in it is run as a script).
--
Don
Stecyk
07-23-2005, 09:53 PM
Hi,
I have another question.
When I use my FTP client (FTP Voyager) to copy the URL for my wallpaper graphic file, I get the following:
ftp://ftp.speciousargument.com/big/dom/xspeciousargument/cgi-bin/mt2/mt-static/simages/img_136.gif
Okay, fine, it looks simple enough. I definitely know that the wallpaper file exists and I know its path. So far, so good.
So I modify that to...
http://www.speciousargument.com/cgi-bin/mt2/mt-static/simages/img_136.gif
When I throw that into Firefox, I get an error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webguru@sssppppeciousaargument.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.33 Server at www.speciousargument.com Port 80
I put the above stuff in code so that the url and email address are not active. Actually, I am going to disguise the email address so that bots don't automatically pick it up.
What am I doing wrong?
What I am trying to do is get the path so that I can create my CSS stylesheet, and have it pick up my wallpaper file. In the latest version of Movable Type, the static files now have their own directory that resides within the cgi-bin directory.
I look forward to your assistance.
Best regards,
Kevin
Stecyk
07-23-2005, 10:02 PM
Just a quick follow-up: I tried to access Movable Type graphic in a similar manner--that is, I put their addresses into the address bar of Firefox to see what happened. I just got the same error message. However, when using the beta version of the new MT 3.2, the graphics appear as they are supposed to.
I have a hunch that files inside cgi-bin cannot be accessed from the outside. If that is the case, am I still okay with having my wallpaper graphic for my stylesheet located in the cgi-bin?
I look forward to your guidance.
Best regards,
Kevin
Stecyk
07-23-2005, 10:03 PM
Hi Don,
You can. The directory is aliased (actually, scriptaliased, which is why everything in it is run as a script).
Thank you very much for your answer.
Best regards,
Kevin
sheila
07-23-2005, 10:03 PM
So I modify that to...
http://www.speciousargument.com/cgi-bin/mt2/mt-static/simages/img_136.gif
When I throw that into Firefox, I get an error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webguru@sssppppeciousaargument.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.33 Server at www.speciousargument.com Port 80
What am I doing wrong?
You can't put image files in your cgi-bin directory.
The cgi-bin directory will automatically try to execute any files within it, and since it can't execute the image file it gives an error.
Stecyk
07-23-2005, 10:23 PM
Hi Sheila,
Thank you for responding! I know you are correct. But let me test a few things to better my understanding.
I put the whole enchilada (mt-static) files under my cgi-bin and everything worked in MT 3.2. MT 3.2 had to reference the graphic files in the mt-static directory, and it seemed to be able to manage. Any ideas as to why? This is more of a curiousity question.
Please have a quick boo at http://www.sixapart.com/movabletype/beta/2005/07/mt32-beta-2.html#more
There it says,
All static files are now bundled in one directory called mt-static. If you are installing Movable Type into the cgi-bin, you can move that entire directory to somewhere under your web root and set the StaticWebPath to specify the path to the files (should end in mt-static/)
So it appears that I didn't follow directions very well. I ought to have placed my files somewhere under the www directory, true?
I am going to do that now.
Thank you Sheila for your help.
Best regards,
Kevin
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.