Daniel Robinson
Daniel Robinson

Reputation: 14848

website directory structure and file paths

I am attempting to make a small website with a directory structure like this:

rootURL/
    landing/
    aboutME/
    common/
    app1name/
    app2name/
    etc...

Within each of the sub folders are the directories css/ , js/ and html/ so I keep my pages and apps separate and my file types separate within them, which seems sensible to me.

My root page I want to load when some one goes to rootURL.com is

rootURL/landing/html/landing.htm

1) Is this something which can be typically configured on a web server?

2) And is it possible to reference paths to css and script files in different directories? For example my lanidng page rootURL/landing/html/landing.htm , can it use the line

<script type="text/javascript" src="rootURL/common/jQuery.js"></script>

and if not is there anothr way to access files in other directories?

Thanks

Upvotes: 0

Views: 1002

Answers (1)

gcochard
gcochard

Reputation: 11744

All of that is possible. For your landing page, will either have to have a redirect page in the root directory, use URL rewriting, or simply put your home page in the root directory.

To reference paths you can use

<script type="text/javascript" src="/path/to/file.js">

or

<script type="text/javascript" src="../relative/path/to/file.js">

or

<script type="text/javascript" src="http://rootURL.com/path/to/file.js">

Upvotes: 2

Related Questions