diff --git a/src/plugins/help/helpviewer.cpp b/src/plugins/help/helpviewer.cpp
index a88393c66574c795eb3c9505283162a04d68f995..76a8758d41bf2609acf2f4ceb6c9e2d02e7dba67 100644
--- a/src/plugins/help/helpviewer.cpp
+++ b/src/plugins/help/helpviewer.cpp
@@ -44,14 +44,12 @@
 
 using namespace Help::Internal;
 
-QString HelpViewer::DocPath = QString::fromLatin1("qthelp://com."
-    "trolltech.qt.%1/").arg(QString(QLatin1String(QT_VERSION_STR))
-    .replace(QLatin1String("."), QLatin1String("")));
+const QString HelpViewer::DocPath = QLatin1String("qthelp://com.trolltech.");
 
-QString HelpViewer::AboutBlankPage =
+const QString HelpViewer::AboutBlankPage =
     QCoreApplication::translate("HelpViewer", "<title>about:blank</title>");
 
-QString HelpViewer::PageNotFoundMessage =
+const QString HelpViewer::PageNotFoundMessage =
     QCoreApplication::translate("HelpViewer", "<title>Error 404...</title><div "
     "align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'"
     "</h3></div>");
diff --git a/src/plugins/help/helpviewer.h b/src/plugins/help/helpviewer.h
index 45c33e95d95deb401190382828373e91f08aa3e7..5477b7cd7b5bcff694de4b770be17547339e7136 100644
--- a/src/plugins/help/helpviewer.h
+++ b/src/plugins/help/helpviewer.h
@@ -85,9 +85,9 @@ public:
     bool findText(const QString &text, Find::IFindSupport::FindFlags flags,
         bool incremental, bool fromSearch);
 
-    static QString DocPath;
-    static QString AboutBlankPage;
-    static QString PageNotFoundMessage;
+    static const QString DocPath;
+    static const QString AboutBlankPage;
+    static const QString PageNotFoundMessage;
 
     static bool isLocalUrl(const QUrl &url);
     static bool canOpenPage(const QString &url);
diff --git a/src/plugins/help/helpviewer_qwv.cpp b/src/plugins/help/helpviewer_qwv.cpp
index 7020a2b01896d8657e9a5b6462509a3d1b484d19..49508662f75d70e7417a8b70db6360c5a1fbe005 100644
--- a/src/plugins/help/helpviewer_qwv.cpp
+++ b/src/plugins/help/helpviewer_qwv.cpp
@@ -133,9 +133,10 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/,
     // the virtual folder
     if (!engine.findFile(url).isValid()) {
         if (url.startsWith(HelpViewer::DocPath)) {
-            if (!url.startsWith(HelpViewer::DocPath + "qdoc/")) {
-                url = url.replace(HelpViewer::DocPath,
-                    HelpViewer::DocPath + QLatin1String("qdoc/"));
+            QUrl newUrl = request.url();
+            if (!newUrl.path().startsWith(QLatin1String("/qdoc/"))) {
+                newUrl.setPath(QLatin1String("/qdoc/") + newUrl.path());
+                url = newUrl.toString();
             }
         }
     }