To keep your styles, either change you links to absolute URI's (they start with a /
) or add this to the page header:
<base href="/" />
The reason why you can't get your styles is because the browser appends a URI base to relative URLs. So say the browser loads this page:
http://yourdomain.com/foo/
the rewrite rules will internally rewrite the URI to /foo.html
but the browser still thinks it's loading /foo/
. The extra slash means the relative URI base is no longer /
, but /foo/
. So for all relative links, the browser will append /foo/
to the beginning. If you specify that the relative URI base is /
then the browser will simply append /
(like it does for non-trailing slash pages).