\documentclass{article}
\usepackage{ulem}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{headings}
\begin{document}
Note: this is Apache-centric but read on at the end for a [[\# IIS a potential IIS solution]]<br />
Note: works only with horde 3<br />
\textit{\textbf{For Apache:}}<br />
The wvHtml component of wvWare <a href="http://wvware.sf.net">http://wvware.sf.net</a> can be used to generate HTML renderings of Microsoft Word documents.  If wvHtml is installed, and Horde is configured to use it to view Word Documents, the msword MIME Viewer class will be invoked to generate the converted HTML document.  Any embedded contents of the Word Document, specifically graphics, will be placed in the upload\_tmp\_dir location, as configured in your php.ini, OR, if you have defined tmpdir in horde/conf.php, that value will be used.

However, the MIME viewer class for msword returns a web page that includes image links that point to the Horde webroot.  A solution some people have used is to modify the Horde or IMP code to actually write the graphics files to those locations, but this has security implications.

A more secure solution, which requires no modification to Horde, or IMP, is to leverage the Apache mod\_rewrite module to rewrite wvHtml graphics links on the fly and redirect them to your temporary directory.

To do this, you must obviously have Apache installed, and the mod\_rewrite module installed and enabled for your Horde installation (see the Apache mod\_rewrite documentation for configuration information<a href="http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html">http://httpd.apache.org/docs-2.0/mod/mod\_rewrite.html</a>)

\begin{itemize}
\item Figure out your upload\_tmp\_dir value (referred to as \$tmpdir from here on out)
\begin{itemize}
\item If using the default PHP value, this is usually /tmp.


\item If you have set 'tmpdir' in horde/conf.php, use this value instead.


\item \textbf{Regardless, this directory should NOT be located underneath your Apache ``<a href="https://wiki.horde.org/DocumentRoot">DocumentRoot</a>``}


\end{itemize}

\item Make sure you have horde/mime\_drivers.php configured to use wvHtml for msword documents


\item Add a ``<a href="https://wiki.horde.org/RewriteRule">RewriteRule</a>`` to your Apache configuration
\begin{itemize}
\item \texttt{``[RewriteRule](RewriteRule) \^{}\$webroot/imp/msword(.+) \$tmpdir/msword\$1 [L](L)``}


\end{itemize}

\item Restart Apache


\item View Word documents with graphics, in all their glory :)


\end{itemize}
As an example:

If:<br />
Horde configurations:

\begin{itemize}
\item \texttt{\$conf['tmpdir']=/var/www/tmp} (\$tmpdir=/var/www/tmp)


\item \texttt{\$registry['webroot']['horde']= /horde} (\$webroot=/horde)<br />
Apache configuration:


\item \texttt{``[DocumentRoot](DocumentRoot)  "/var/www/virtualdomains/yourdomain/horde"``}


\end{itemize}
Then your ``<a href="https://wiki.horde.org/RewriteRule">RewriteRule</a>`` for Apache becomes:<br />
\texttt{``[RewriteRule](RewriteRule) \^{}/horde/imp/msword(.+) /var/www/tmp/msword\$1 [L](L)``}

[\# IIS ]<br />
\textit{\textbf{For IIS:}}<br />
Rewriting functionality in a default configuration of IIS is limited.  However, similar functionality should be attainable by using ISAPI\_rewrite<a href="http://www.isapirewrite.com">http://www.isapirewrite.com</a>.  A lite version is available for free and the above syntax should work, although this author has not tested a configuration with IIS.

KMM

\end{document}
