Optimal file structure on the server

This is a discussion on "Optimal file structure on the server" within the Website Planning section. This forum, and the thread "Optimal file structure on the server are both part of the Planning Your Website category.



Go Back   Webforumz.com > Main Forums > Planning Your Website > Website Planning

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 19th, 2007, 09:26
New Member
Join Date: Jun 2007
Location: Sweden
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Optimal file structure on the server

Hi!
I've run into a problem with my site, which I hope someone can help me get rid of. As usual I have an ant heap of questions and thoughts, but I'll try to explain the problem carefully.

What I want to accomplish is a site with CSS styles, a JS-menu, where the pages are composed by several .asp files.

I'm about to start creating all unique pages, but it struck me that some subfolders on the server would be useful to make it easier to maintain the site...

This is what I'd like it to look like:
WEBROOT
L scripts (my menu and css)
L images (pictures)
L _products (folder containing all unique files for "products"
L _services (folder.....)
L _justnu (folder...)
L _....
All files corresponding to the choices in the menu directly in webroot.

But this doesn't work as I thought it would, and I don't understand why .

Is there a better more "safe" structure to use? How should my structure look like to work as I want it to do?


I've created a template that looks like this:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <!-- #INCLUDE FILE="metahead.asp" -->
  <title>Torsdagsdemo</title>
 
 </head>
 <body>
  <div id="active">
 
  <div id="header"><img src="images/mkvab_100.jpg" alt="MKVAB Logo" border="0"><!-- #INCLUDE FILE="menu.asp" --></div>
 
  <div id="contents">
  <!-- #INCLUDE FILE="_justnu/torsdagar.asp" -->
  </div>
  </div>
 
  <!-- #INCLUDE FILE="footer.asp" -->
 
 </body>
</html>
And it is with my contents I run into problems, since the server simply doesn't display the page. (HTTP 500 Internal server error...)

Is it correct to assume it is possible to include a file from another folder like this?

Can it somehow be connected to how my metahead.asp file is coded?
(There are probably many better ways of doing this, but I believe I must still be considered a newbee.)

Code: Select all
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="copyright" content="Mälardalens Kyl & Ventilation AB"/>
<meta name="keywords" content="mkvab, värmepump, bergvärme, ac"/>
<meta name="description" content="Företagsinformation....."/>
<script type="text/javascript" src="scripts/dropdown.js"></script>
<script type="text/javascript" src="scripts/scripts.js"></script>
<link rel="stylesheet" href="scripts/menu_style.css" type="text/css"/>
<link rel="stylesheet" href="scripts/main_style.css" type="text/css"/>
The metahead.asp is located in the webroot folder.

Where does the server get lost and what have I done wrong?


Kind regards,
Foobster
Reply With Quote

  #2 (permalink)  
Old Jun 19th, 2007, 11:35
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Optimal file structure on the server

I'm not familiar with ASP (I use old-fashioned SSI), but here's a couple of ideas:
  • You seem to have a space in your file names: "L scripts", " L _products". I would avoid this, because I think web servers are likely to choke on file names with spaces.
  • Should your included file be a .asp, or just a plain text file .txt? For SSI it's normally .txt.
  • Does the webpage work without the includes? I always start with a complete page, then remove code to includes once my design is stable.
  • You might want to read up on the syntax of your includes. For SSI, for example, you can use a "virtual" method that works from the site root, but another method is relative to the document.
Reply With Quote
  #3 (permalink)  
Old Jun 19th, 2007, 13:11
New Member
Join Date: Jun 2007
Location: Sweden
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Optimal file structure on the server

Thanks for your reply MikeHopley!

What you saw and noted on was just a lame attempt to illustrate the file tree... The folders do not have spaces. I've named them:
_information
_justnu
_kontaktaoss
etc...

Why am I using .asp? No idea, first I thought it was necessary for including files in this way. And on .asp-sites many considers .asp to be a better than .inc. So, for the moment, there is really no reason for me to use asp, since including files can be done with plain html?

I haven't tried coding it without includes, but since my problem is specifically connected to them I don't see how it'd help me uncover the problem.

I know about the two ways, "file" and "virtual". They should both work... but I think the problem can be linked to how I had divided my template.

Here is an attempt to describe the problem:

webroot contains :
folder1 (css-styles, and JS-menu)
folder2 (an asp-file containing a heading and a paragraph)

metahead.asp (meta-text)
menu.asp (the menu)
menu-alt1.asp
...
menu-altx.asp
footer.asp (a footer)

What I want to do in every menu-alt-file is:
Apply title, and eventual override styles, etc...
include metahead.asp from same dir
include contents from folder2
include footer from same dir

(Until a moment ago I called the style sheats from folder1 in metahead.asp. I thought this was brilliant, but I have now changed it and put the links in every menu-alt-page instead, just in case this was causing some problems...)

But the problem remains, the code below does not work.
<!-- #INCLUDE FILE="justnu/torsdagar.asp" -->

However, it seems like it works if I change the extension to something else... anything else.

(I'm sure I tested this before, but perhaps not when I had the style links in the metahead-file. Perhaps I should put them back there...)

This raises some questions which has more to do with asp and ssi, which I'll address in that forum instead.
Reply With Quote
  #4 (permalink)  
Old Jun 19th, 2007, 13:18
New Member
Join Date: Jun 2007
Location: Sweden
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Optimal file structure on the server

More to the topic then, as my other problem seems to have been the servers fault...

Is it a good idea to create a folder for each menu, and store the unique contents (to include) in there?

Some seem to have ONE folder containing all includes instead, but I think this would make it harder to understand the structure of the site in relation to the file structure on the server. And since the site will be maintained by people with with an even more (extremely more) newbeeility than I, I though this approach would help.

Folders or not, how do you arrange your sites?
Reply With Quote
  #5 (permalink)  
Old Jun 19th, 2007, 13:22
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Optimal file structure on the server

I usually put all includes in one folder. My structure is usually like this

root /
|-- about /
|-- css /
|-- i /
|-- inc /
|-- js /
|-- portfolio /
|-- services /
|-- etc.....
Reply With Quote
  #6 (permalink)  
Old Jun 19th, 2007, 14:10
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Optimal file structure on the server

I use almost the same structure as Karinne's, but I put all my "techy stuff" inside a source folder:

root /
|-- source /
|-- css /
|-- images /
|-- ssi /
|-- js /
|-- images /
|-- some-site-content-section /
|-- another-site-content-section /

The second "images" folder is for content images, as opposed to design decorations.
Reply With Quote
Reply

Tags
file structure, folders, includes

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing an XML file from Localhost to Server... JustinStudios Classic ASP 1 Apr 13th, 2007 21:27
Upload File to Server Via Email Kenny Fix Classic ASP 0 Nov 6th, 2006 17:10
URGENT!!!! Send HTTP request from one web server to another server chandra.nowduri ASP.NET Forum 1 Aug 7th, 2006 19:18
Need to process data on one server, utilize it on another server ... can it be done? jaobrien Classic ASP 1 Dec 6th, 2005 00:58


All times are GMT. The time now is 00:28.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43