子目录/文件夹作为URL? (新手问题) [英] Subdirectories/folders as URLs? (novice question)

查看:105
本文介绍了子目录/文件夹作为URL? (新手问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的理解 - 我不是专家 - 是(有些?很多?全部?)

标准互联网服务器URL可以指向子目录名称

后跟一个反斜杠,并且链接到此URL将自动

转到index.html文件位于该子目录中,如果有的话。


Q1:这或多或少是正确的吗?


至少还有一些HTML文本建议使用此作为组织网站的基础:将与特定

或隔离子主题相关联的网页放入适当命名的子目录中(或

subsubdirectory)在主网站的顶级目录中;使用位于该子目录中的

index.html文件作为home

page"用于链接到该子目录中的那些子主题页面;并且

使用子目录的名称作为主要URL,用于从外部或从网站层次结构中的较高层链接到该

子主题。
< br $>
Q2:这是一个好建议吗?


但是如果我试图自己开发和测试一个完整的网站

(Mac iBook OS 9)计算机在上传到我大学的服务器之前,

我不能这样做,因为子目录是这个环境中的文件夹

我最好能告诉在我自己的机器上运行的浏览器不能将

链接到文件夹作为URL。


Q3:如果这是正确的,它周围有什么办法吗? (在Mac OS 9上

级别,或者如果我升级到Mac OS X)


感谢您的任何建议或帮助。

My understanding -- I''m not an expert -- is that on (some? many? all?)
standard Internet servers a URL can point to a subdirectory name
followed by a backslash, and that links to this URL will automatically
go to an "index.html" file located in that subdirectory, if there is one.

Q1: Is this more or less correct?

At least some HTML texts also recommend using this as the basis for
organizing a web site: Put the web pages associated with some specific
or isolated subtopic into an appropriately named subdirectory (or
subsubdirectory) within the main web site''s top level directory; use an
index.html file located in that subdirectory to serve as the "home
page" for links to those subtopic pages within that subdirectory; and
use the subdirectory''s name as the primary URL for linking to that
subtopic from outside or from higher up in the web site hierarchy.

Q2: Is this good advice?

But if I''m attempting to develop and test a complete web site on my own
(Mac iBook OS 9) computer before uploading it to my university''s server,
I can''t do this, because subdirectories are folders in this environment
and as best I can tell browsers operating on my own machine can''t link
to folders as URLs.

Q3: If this is correct, is there any way around it? (at the Mac OS 9
level, or if I upgrade to Mac OS X)

Thanks for any advice or assistance.

推荐答案

AES / newspost< si ***** @ stanford.edu>在新闻中写道:siegman-
A6 **** ***************@news.stanford.edu
AES/newspost <si*****@stanford.edu> wrote in news:siegman-
A6*******************@news.stanford.edu:
我的理解 - 我不是专家 - - 那是(有些?很多?全部?)
标准的互联网服务器URL可以指向子目录名称
后跟反斜杠,并且链接到此URL将自动转到一个index.html文件位于该子目录中,如果有的话。

Q1:这或多或少是正确的吗?


" \"是反斜杠,/是斜线或前锋。如果您认为反斜杠可用于URL,则不清楚




至于''索引目录'',这里Apache的处理方式是:
http: //httpd.apache.org/docs/mod/mod...directoryindex
http://httpd.apache.org/docs/mod/mod_autoindex.html

至少一些HTML文本也建议使用此作为基础用于组织网站:将与某些特定
或隔离子主题相关联的网页放入主网站顶级目录中相应命名的子目录(或
子目录)中;使用位于该子目录中的
index.html文件作为主页
页面。用于链接到该子目录中的那些子主题页面;


到目前为止,非常好(也许)....

并使用子目录的名称作为链接到该来自外部或来自网站层次结构中较高层的子主题。


这可能不是一个好建议。您可能需要阅读

Cool URIs not not change作者:Tim Berners-Lee:
http://www.w3。组织/提供者/风格/ URI

但是如果我在上传之前尝试在我自己的(Mac iBook OS 9)计算机上开发和测试一个完整的网站它到我大学的服务器
My understanding -- I''m not an expert -- is that on (some? many? all?)
standard Internet servers a URL can point to a subdirectory name
followed by a backslash, and that links to this URL will automatically
go to an "index.html" file located in that subdirectory, if there is one.

Q1: Is this more or less correct?
"\" is a backslash, "/" is a slash or forwardslash. It''s not clear
from your wording if you think backslashes can be used in URLs.

As for ''indexing a directory'', here''s how Apache handles it:
http://httpd.apache.org/docs/mod/mod...directoryindex
http://httpd.apache.org/docs/mod/mod_autoindex.html
At least some HTML texts also recommend using this as the basis for
organizing a web site: Put the web pages associated with some specific
or isolated subtopic into an appropriately named subdirectory (or
subsubdirectory) within the main web site''s top level directory; use an
index.html file located in that subdirectory to serve as the "home
page" for links to those subtopic pages within that subdirectory;
So far, so good (maybe) ....
and use the subdirectory''s name as the primary URL for linking to that
subtopic from outside or from higher up in the web site hierarchy.
That may not be good advice. You might want to read
"Cool URIs don''t change" by Tim Berners-Lee:
http://www.w3.org/Provider/Style/URI
But if I''m attempting to develop and test a complete web site on my own
(Mac iBook OS 9) computer before uploading it to my university''s server




无论如何你都不能在你自己的系统上正确测试,因为你

避风港''重复了大学的网络服务器环境。对于

示例,您可能会发现他们的网络服务器为您的

页面提供了导致您出现问题的HTTP标头。


-

Dave Patton

加拿大协调员,学位合流项目
http://www.confluence.org/

我的网站: http://members.shaw.ca/davepatton/


文章< si ***** **********************@news.stanford.edu>,

AES / newspost< si ***** @ stanford.edu>写道:
In article <si***************************@news.stanford.edu >,
AES/newspost <si*****@stanford.edu> wrote:
我的理解 - 我不是专家 - 是(某些?很多?全部?)
URL可以指向的标准Internet服务器一个子目录名
后跟一个反斜杠...


我相信你的意思是一个固定的:即一个正斜杠。但无论如何......

和这个URL的链接将自动转到位于该子目录中的index.html文件(如果有的话)。
<问:Q1:这或多或少是正确的吗?


如果网络服务器配置正确的话。如果URL只是一个

路径 - 没有附加文档名称 - 可以将Web服务器配置为

尝试返回默认文档(例如,index。该路径的html"。

通常可以在优先级

列表中指定几个默认文档名称。


At至少一些HTML文本还建议使用它作为组织网站的基础:

Q2:这是一个好建议吗?


好​​吧,子目录对于组织文件非常有用,无论是
网站的一部分还是别的。


就个人而言,就默认文件而言,我对他们的实用性并不感兴趣。一方面,它可以使

访问者和作者的生活更轻松,而不必指定一个完整的路径(特别是,主页上的,尤其是
)。依赖服务器的

默认文档配置的主要风险是,如果将站点移动到具有不同配置的不同服务器,那么,路径-only

链接可能不再起作用。然而,这是一个很小的风险:它很可能是你能够适当配置新服务器的价格。


可能更重要事情,尤其是来自你的访客'

的观点,是一致性。不要使用
http://www.example.com /foo/index.html 在某些情况下和
http:/ /www.example.com/foo/ 在其他人...如果你打算他们在同一份文件中提及

。从浏览器的角度来看,它们是不同的

文档,这会影响缓存和访问链接突出显示。

但是如果我正在尝试开发和在我上传到我大学的服务器之前,在我自己的(Mac iBook OS 9)计算机上测试一个完整的网站,
我不能这样做,因为子目录是这个环境中的文件夹<我最好能告诉在我自己的机器上运行的浏览器无法将URL链接到文件夹。

问题3:如果这是正确的,有什么方法可以解决它?
My understanding -- I''m not an expert -- is that on (some? many? all?)
standard Internet servers a URL can point to a subdirectory name
followed by a backslash...
I believe you mean a solidus: i.e., a forward-slash. But anyway...
and that links to this URL will automatically go to an "index.html"
file located in that subdirectory, if there is one.

Q1: Is this more or less correct?
It is if the webserver is configured appropriately. If the URL is only a
path -- no document name appended -- the webserver can be configured to
try to return a default document (e.g., "index.html") for that path.
Often several default document names can be specified, in a prioritized
list.

At least some HTML texts also recommend using this as the basis for
organizing a web site:

Q2: Is this good advice?
Well, subdirectories are useful for organizing files, whether part of a
web site or something else.

Personally, w/regard to default documents, I''m a little on the fence as
to their usefulness. On one hand, it can make life easier for both the
visitor and author to not have to specify a full path (think,
especially, of the home page). The main risk of relying on the server''s
default document configuration is that if the site is moved to a
different server with a different configuration, well, the path-only
links may no longer function. This is a small risk, however: it''s likely
you''ll be able to configure the new server appropriately.

Probably the more important thing, particularly from your visitor''s
point of view, is consistency. Don''t use
http://www.example.com/foo/index.html in some cases and
http://www.example.com/foo/ in others ... if you intend them to refer to
the same document. From the browser''s point of view, they are different
documents, which affects caching and visited-link highlighting.
But if I''m attempting to develop and test a complete web site on my own
(Mac iBook OS 9) computer before uploading it to my university''s server,
I can''t do this, because subdirectories are folders in this environment
and as best I can tell browsers operating on my own machine can''t link
to folders as URLs.

Q3: If this is correct, is there any way around it?




否:浏览器与它无关(几乎:例外情况是

浏览器请求是路径但不是不以正斜杠结束。

默认文档由网络服务器处理,而不是由浏览器处理。你需要在你的笔记本电脑上运行一个网络服务器。我不确定OS9是否包含/可用于
,但OSX附带Apache并且易于设置

说明。


-

Joel。

http://www.cv6.org/

她也可以自豪地说:

我已经为州提供了一些服务。



No: the browser has nothing to do with it (almost: the exception is when
the browser request is a path but doesn''t end with a forward-slash).
Default documents are handled by a webserver, not by the browser. You
need to run a webserver on your laptop. I''m not sure if one is
included/available for OS9, but OSX comes with Apache and easy setup
instructions.

--
Joel.

http://www.cv6.org/
"May she also say with just pride:
I have done the State some service."


" AES / newspost" < SI ***** @ stanford.edu>写在

comp.infosystems。 www.authoring.html:
"AES/newspost" <si*****@stanford.edu> wrote in
comp.infosystems.www.authoring.html:
我的理解 - 我不是专家 - 是(有些?很多?全部?)
标准的互联网服务器,URL可以指向子目录名称
后跟反斜杠,链接到此URL将自动转到index.html。文件位于该子目录中,如果有的话。

Q1:这或多或少是正确的吗?


减去。 :-)反斜杠是Windows中路径的Microsoft主义和/或
DOS。在URL中,分隔符是斜杠。


例如,
http://www.acad.sunytccc.edu/instruct/sbrown/stat/

获取我的统计课程的索引页面。


几个笔记:


a。该页面可能会或可能不会被称为index.htm。这取决于

服务器,所以你应该找出默认页面的内容。适用于您的

服务器。


b。一些服务器设置如果没有默认页面,

a URL在上面的表单中获取目录列表,然后

访问者可以通过文件名选择。通常这不是一个有用的

界面,所以通常的好习惯是确保每个

目录都有一个默认页面。

将与某些特定
或隔离子主题相关联的网页放入主网站顶级目录中相应命名的子目录(或
子目录)中;使用
index.html

Q2:这是一个好建议吗?


一般是的。我认为对于新手Web作者,我们可以放弃

一般。 :-)


高级作者使用URL播放各种游戏,因为URL

并不一定要反映目录结构。 />
但是,如果我想在我自己的
(Mac iBook OS 9)计算机上开发和测试一个完整的网站,然后再将其上传到我大学的服务器,
我不能这样做,因为子目录是这个环境中的文件夹
并且我最好能告诉在我自己的机器上运行的浏览器不能作为URL链接到文件夹。
<问题3:如果这是正确的,有什么办法吗? (在Mac OS 9级别,或者如果我升级到Mac OS X)
My understanding -- I''m not an expert -- is that on (some? many? all?)
standard Internet servers a URL can point to a subdirectory name
followed by a backslash, and that links to this URL will automatically
go to an "index.html" file located in that subdirectory, if there is one.

Q1: Is this more or less correct?
Less. :-) The backslash is a Microsoftism for paths in Windows and
DOS. In URLs the separator is a slash.

For instance,
http://www.acad.sunytccc.edu/instruct/sbrown/stat/
gets the index page for my statistics course.

A couple of notes:

a. The page may or may not be called "index.htm". That varies by
server, so you should find out what the "default page" is for your
server.

b. Some servers are set up that if there''s no default page present,
a URL in the above form gets a directory listing, and then the
visitor can choose by filename. Generally that''s not a helpful
interface, so it''s usually good practice to make sure every
directory has a default page present.
Put the web pages associated with some specific
or isolated subtopic into an appropriately named subdirectory (or
subsubdirectory) within the main web site''s top level directory; use an
index.html

Q2: Is this good advice?
Generally yes. I think for novice Web authors we can drop the
"generally". :-)

Advanced authors play all sorts of games with URLs, because the URL
doesn''t necessarily have to reflect a directory structure.
But if I''m attempting to develop and test a complete web site on my own
(Mac iBook OS 9) computer before uploading it to my university''s server,
I can''t do this, because subdirectories are folders in this environment
and as best I can tell browsers operating on my own machine can''t link
to folders as URLs.

Q3: If this is correct, is there any way around it? (at the Mac OS 9
level, or if I upgrade to Mac OS X)




您可以在计算机上安装服务器,如果你'正在做你想要的严肃的Web开发。

不过我不知道建议使用特定的Mac软件。


-

Stan Brown,Oak Road系统,美国纽约州汤普金斯县
http://OakRoadSystems.com/

HTML 4.01规范: http://www.w3 .org / TR / html401 /

验证人: http: //validator.w3.org/

CSS 2.1规范: http://www.w3.org/TR/CSS21/

验证器: http://jigsaw.w3.org/css-validator/



You can install a server on your computer, and if you''re doing
serious Web development you probably want to. I don''t know of
specific Mac software to suggest, though.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/


这篇关于子目录/文件夹作为URL? (新手问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆