Create Directories and Landing Pages

The file structure

On ONID, as on any other web server, you can have many sites within your root directory. Consider making a directory for each site you have planned, rather than mixing them all up.

  1. On your local hard drive, add a directory named for your public site.
    • Web site directories listed on a hard drive.Examples of names of directories and the address a visitor would type. Also see the hard drive list illustration at the right:
      • /courses/
        • http://oregonstate.edu/~vanlondp/courses
      • /blog/
        • http://oregonstate.edu/~vanlondp/blog
      • /vita/
        • http://oregonstate.edu/~vanlondp/vita
    • Add a file called index.htm (or index.php for dynamic sites) to the new site directory.
      • Index pages are the default landing page of each directory. Every directory that will have pages with content should have an index page.
      • Directories that do not require index pages are images, media, scripts, Templates, etc.
      • Note that on Microsoft servers (as apposed to Apache) use default.htm as the default page.
      • Default pages will automatically appear when you type the path to the directory because the server recognizes it as default by its name.
    • Sample file structure for ONIDNote: If you’re going to keep you site hidden—it’s private—then you can bury it within a class folder if you wish.
  2. Add a directory called images
    • to the site directory.
  3. If using .htm pages then add a directory for each main topic.
    • Keep the names as similar to the planned menu items as possible.
    • Add index.htm files to each directory.
      • Option-drag (Macintosh) or Control-drag (Windows) the previous index.htm file into each directory and subdirectory.
      • Note: there is nothing on these index files yet; we’ll apply templates to them later.
    • Add images directories to each topic directory that will have image files unique to that topic.
  4. Example of the course directory with php structure.If you are using .php pages and dynamic content, add just one page for each section rather than a directory for each section.
    • Place snippets of content such as articles, quotes, comments, etc into separate .htm or .php pages, or write queries to pull content from a database. More on this later in CS 295.
  5. Add subdirectories to topic directories as needed.
    • Add index.htm files to each subdirectory.
    • Add images directories to each subtopic directory that will have image files unique to that topic.
  6. Copy the completed structure to ONID‘s web server space in the public_html area.