diff --git a/contents/help/index.html b/contents/help/index.html
index 57927c34df3ca1c19e8a24aefa78eea6edba989f..55d0ff98411e6a9c489431e82dd9a5fa6bd38f85 100644
--- a/contents/help/index.html
+++ b/contents/help/index.html
@@ -21,7 +21,7 @@
   <h3>Need any help?</h3>
   <p>For any questions regarding StarPU, you can
     <ul>
-      <li>Read the latest <a href="/files/testing/master/doc/html">documentation</a>,
+      <li>Read the latest <a href="/files/testing/master/doc/html/">documentation</a>,
       and more specifically the <a href="/files/testing/master/doc/html/FrequentlyAskedQuestions.html">FAQ</a>,</li>
       <li>Read the <a href="/tutorials/">tutorials</a>,</li>
       <li>Browse
diff --git a/contents/index.html b/contents/index.html
index e0547de0c63968a6ea6991b3165ddb26e9a5e671..451fc667c149cdadba23d345279d5e2580912cee 100644
--- a/contents/index.html
+++ b/contents/index.html
@@ -68,7 +68,7 @@ StarPU.
 </p>
 <p>
 The latest documentation in <a href="/files/testing/master/doc/starpu.pdf">PDF</a>
-and <a href="/files/testing/master/doc/html">HTML</a> is updated everyday, but covers
+and <a href="/files/testing/master/doc/html/">HTML</a> is updated everyday, but covers
 the latest developments which may not be available in the latest release.
 </p>
 </div>
diff --git a/scripts/createWebServer.sh b/scripts/createWebServer.sh
index 613bebf2fe3dd17b892519c2feda49c62db123e5..d5f836ff7024347e8746757aa0db58bd126bc1b6 100755
--- a/scripts/createWebServer.sh
+++ b/scripts/createWebServer.sh
@@ -2,32 +2,55 @@
 
 dir=$(dirname $0)
 
-createRedirect()
+createRedirectFile()
 {
-    while read line
-    do
-	src=$(echo $line | awk '{print $1}')
-	dst=$(echo $line | awk '{print $2}')
-	echo create redirect from $src to $dst
-	mkdir -p public/$src
-	(cat <<EOF
+    src=$1
+    dst=$2
+    (cat <<EOF
 <head>
 <title>Page has moved!</title>
 <meta http-equiv="Refresh" content="0; URL=$dst" />
 </head>
 
 EOF
-	) > public/$src/index.html
+    ) > public/$src
+}
+
+createRedirectDir()
+{
+    src=$1
+    dst=$2
+    mkdir -p public/$src
+    createRedirectFile $src/index.html $dst
+}
+
+createRedirect()
+{
+    while read line
+    do
+	src=$(echo $line | awk '{print $1}')
+	dst=$(echo $line | awk '{print $2}')
+	echo create redirect from $src to $dst
+	createRedirectDir $src $dst
     done< $dir/redirect.txt
 }
 
 updateFileLinks()
 {
-    for f in $(grep -rsl 'href="/files' public)
+    for x in $(grep -rs 'href="\/files/' public | tr ' ' '\012' | tr '\t' '\012' | grep href | sed -e 's/href="//' -e 's/".*//' -e 's/#.*//' | sort | uniq)
     do
-	echo update file links in $f
-	sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
+	echo "create redirect for $x"
+	case "$x" in
+	    */) createRedirectDir $x "http://starpu.gforge.inria.fr$x" ;;
+	    *)  mkdir -p public/$(dirname $x) && createRedirectFile $x "http://starpu.gforge.inria.fr$x" ;;
+	esac
     done
+
+	#    for f in $(grep -rsl 'href="/files' public)
+	#    do
+	#	echo update file links in $f
+	#	sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
+	#    done
 }
 
 rm -rf public