Module Website Guide

Francis Wright
Director of Undergraduate Studies
11 December, 2009

It is established School policy that organisers of undergraduate modules should construct a website for each of their modules. This guide provides some additional information about how to do this. It should be read in conjunction with the existing guidance available on the School intranet.

URLs and filenames

Each module should have its own dedicated website. If your departmental computer username is xyz and the module code is MTH1234 then the module website should be accessible using the URL

and this is the module website URL that should appear in the departmental web page (see below) for module MTH1234. However, this need not be the actual URL, i.e. it need not correspond directly to the filesystem name of the file that is served when a browser visits the URL. This is because web servers are normally configured to be liberal and apply various search algorithms to find the file to serve. I will try to describe how the Maths web server maps URLs to files.

The URL http://www.maths.qmul.ac.uk/~xyz maps to the file store directory ~xyz/public_html, i.e. the directory public_html in the root of your file store on the Maths fileserver. The web server will look for the filename as given and will also look for the filename with various extensions; in particular it will try appending .html and .htm. (Microsoft applications tend to prefer .htm.) If the filename actually refers to a directory then the server will look for the filename index in that directory, and it will also try appending its standard set of extensions. (If there is no index file then the web server will display a listing of the directory contents.)

Given this information, I recommend that you create a directory named MTH1234 in your public_html directory and then create your main module web page as the file index.html in that directory. This approach has the advantage that you can put all other files related to this module in the same directory and easily link to them from the index file.

If you prefer, you can create a file named MTH1234 in your public_html directory and you will probably want to give it an extension of .html (or .htm). But if you put all your web files in the root of your public_html directory you may find it difficult to keep them organised.

If you prefer to put your actual module website somewhere completely different then you can redirect to the real location, which may be almost anywhere, including on a different web server. There are various ways to do this.

The best way is to create a file named .htaccess in your public_html directory that redirects the webserver. For example, when I taught Linear Algebra I with the (old) code MAS212 I set up a .htaccess file containing the line

RedirectPermanent /~fjw/MAS212 http://centaur.maths.qmul.ac.uk/Lin_Alg_I/

This redirects

www.maths.qmul.ac.uk/~fjw/MAS212

to a directory with a different name on a different web server, namely the one that I run on my office PC, centaur. I have kept this line in my current .htaccess file so this redirection still works for demonstration purposes. Hence, if you click on the link above you will see that your web browser actually goes to the new URL.

Another way is to create a file as described above that redirects the user's browser. For example, the URL

www.maths.qmul.ac.uk/~fjw/MAS336

maps to file ~fjw/public_html/MAS336.html, the content of which is as follows:

<html>
<head>
<meta http-equiv="refresh" content="0; URL=http://centaur.maths.qmul.ac.uk/Comp_Prob_Solving/">
</head>
<body>
<p>If your browser has not automatically redirected you, please go to</p>
<p><a href="http://centaur.maths.qmul.ac.uk/Comp_Prob_Solving/" >http://centaur.maths.qmul.ac.uk/Comp_Prob_Solving/</a></p>
</body>
</html>

This redirects to the URL http://centaur.maths.qmul.ac.uk/Comp_Prob_Solving/. However, the W3C strongly discourages using the meta tag in this way (presumably because it causes unnecessary web traffic).

Finally, you can use file system links to give your module website the correct URL. File system links are created using the Unix command ln (which is similar to the copy command cp). Symbolic links (ln –s) are probably better than hard links (ln). (Hard links are fast but fragile; symbolic links are similar to Windows "shortcuts".) File system links only work within the same file system and have the disadvantage that you will need either to use absolute URLs in any links in your module web page or to provide file system links for all relative URLs, neither of which is very convenient. Therefore, I don’t recommend this approach.

Access permissions

Files to be served on the web must be readable by everyone, which will probably not be the case by default. The Unix command ls -l shows the access permissions of all the files in the current directory. They should look something like –rw–rw–r––, where the underlined r is what must be there (without the underline). If the required r is not there then execute the Unix command chmod o+r filename and then check the access permissions again.

Testing your module website

When you have set up, or changed, your module website, please take a look at it using a web browser to access the website via the server (and not directly via the file store). If (and only if) this works correctly for you then it should work correctly for others.

The departmental module web pages

The departmental module web pages are those listed at http://www.maths.qmul.ac.uk/undergraduate/modules/. Please check that the URL for your module web page shown in the departmental module web page looks correct and if so click on it to check that it brings up your module web page correctly. If it doesn't and yuo think that the published URL for your module web page is wrong then please email Vivien and let her know. (It could be wrong because it still refers to a previous module organiser or an old module code, among other reasons.)

If you refer to the departmental module web page then please use the URL that your browser displays when you visit the page, which should have the form

(The reason for the question mark in the URL is that the module code forms a query string that is used to include the correct module description into a skeleton web page, i.e. the web page is generated dynamically, although currently in a trivial way.)

Including non-English characters and symbols

It should be possible to include a very wide range of non-ASCII characters and symbols in web pages, which should be displayed correctly provided the user's browser is not too ancient. For example, there are quite a few accented letters and mathematical symbols in the departmental module web pages. The easiest way to achieve this is probably to rely on the Unicode character encoding, since the Maths web server transmits web pages as Unicode (regardless of what encoding the page claims to use). This is not how the departmental module web pages are currently encoded, but that is largely for historical reasons.

For example, Microsoft Windows provides an accessory called Character Map (in Start / All Programs / Accessories / System Tools) that can be used to insert any Unicode character into any file.

Here are some simple examples that I generated in this way:

The non-ASCII characters above should look exactly the same if you view this page in a web browser or view the HTML source code in a text editor (provided both support Unicode). This approach avoids the need to look up HTML character entities, which are the other way to include non-ASCII characters. (The departmental module web pages currently use character entities.)

File types

Whilst HTML is the lingua franca of the web, you can put files of any type – text or binary – on the web. Generally, the URL will need to match the filename completely because the web server will not search for arbitrary filename extensions, and it is good practice to include some indication that a link refers to a non-HTML file and what the file size is if it is large, as binary files often are.

Plain text files can sometimes be useful, but note that web browsers will not wrap long lines, so you need to keep line lengths reasonably short (e.g. under about 80 characters). A short and interesting example can be found at www.rfc-editor.org/EOLstory.txt.

PDF files are appropriate when it is important to preserve the layout of the pages of a document that has been formatted for printing on paper, and may be the best option for documents containing nontrivial mathematics or scanned bitmaps. PDF can be easily generated from almost any document source using Open Source programs (e.g. PDFLaTeX, PDFCreator) and many applications (such as Microsoft Office 2007) offer built-in facilities to output PDF. So PDF is a good choice for lecture notes, examination papers, exercise sheets and solutions. But PDF has disadvantages that make it inappropriate for straightforward documents on the web: it requires additional support from Adobe Reader to display it and it does not reformat to match window dimensions. Please do not overuse PDF. In particular, the main web page for each module should be an HTML file.

It is not a good idea to put files using proprietary formats on the web without very good reason. In particular, Microsoft Office files are generally best converted to PDF files unless you want users to be able to edit or otherwise manipulate them. Microsoft Word files appear on the web far too often!

Accessibility and markup standards

The first priority is for every module organiser to provide a useful module web page that can be accessed by the majority of students. But we are legally obliged to ensure that all our facilities are accessible to disabled users and the best way to do this is to follow the latest W3C markup guidelines. We should at least ensure that the markup in all our web pages is well formed and valid. Ideally, we should also avoid using deprecated markup and we should keep content and style separate: content should be indicated using HTML and style should be indicated using CSS. This makes assistive technology such as screen readers much more effective. Moreover, web browsers are becoming much more conscious of standards and in future may not display incorrect markup well (e.g. Google Chrome is much less forgiving than earlier browsers).

How to create and edit HTML files

Any text editor can be used, although more sophisticated editors (such as Emacs) provide considerable support, such as tag highlighting, tag menus, automatic tag completion, etc. Line endings are generally not significant in HTML files (except in preformatted text) and any of the default newline conventions used by the Unix (and variants), Windows or Mac OS operating systems (which are all different) can be used.

There are many good free cross-platform editors available, GNU Emacs being one of them. Microsoft provides several free software development tools for Windows, including Visual Web Developer 2008 Express Edition.

Microsoft Word can save documents as HTML (the "Web Page, Filtered" option will give cleaner HTML) and it provides a facility to insert any character (Insert / Symbol) into a document. However, Word tries very hard to preserve the precise formatting of the document which leads to unduly complicated markup.

An easy way to create a module web page is to find an existing one that you like, download it (i.e. save it using your web browser) and then edit it.


Valid XHTML 1.0 Strict  Valid CSS!