tags:

views:

18

answers:

2

hi

what's the best way of porting a static HTML website to a CDROM, to allow users to insert the disk, copy the files off, and then run the site "offline", as it were.

what sort of path structure should i use? at the moment all of the assets are like:

file:///C:/Users/User/Desktop/MySite/index.html

which obviously isn't very portable

thanks for any info

+1  A: 

You should use relative paths, like index.html and images/img.gif.

If you have many absolute links, search for "file:///C:/Users/User/Desktop/MySite/" and replace all with "" (or "./", to make things clearer). Notepad++ can search across all files of one directory.

To make things even clearer, create a subdirectory with all files and more subdirs and optionally an index.html in the root directory, so the user only has to copy one folder (plus one index.html).

Martin
grand, thanks a lot
Ross
This is actually the standard when developing offline for an online site, because this way you simply upload the files/folders and still no links are broken.
Martin
A: 

You can try to use portable web-server application. This application allow to run any websites on any drives (USB-Flash or CDROM). The main advantage that you shouldn't to change links from absolute paths to relative. Also, the application will open your sites if that uses a database or PHP.

For example: XAMPP (Portable Web Server) and many others.

Dmitry