Is it possible for the Subversion Apache module to serve html files with an html content-type without using the svn:mime-type property?

Posted by Martin Pain on Server Fault See other posts from Server Fault or by Martin Pain
Published on 2012-11-23T10:36:02Z Indexed on 2012/11/23 11:02 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

I am aware that if you set the svn:mime-type Subversion property on a .html file to text/html then when viewing the file in a browser through the Subversion module in Apache httpd it will be served with a Content-Type: text/html header, enabling the browser to render it as HTML rather than plain text.

However, I am looking for a way to do this without using the svn:mime-type property.

I'm aware that you can configure your svn client to automatically add the property - this is not what I want, as I do not want to ensure all users have these settings. I'm also aware that I could create a pre-commit hook that rejects the commit if the properties are not set, in order to force users to set the property - I might fall back to that, but I'm looking for something less intrusive.

I'm also aware that I could use a post-commit hook to add the properties automatically on the server-side. I'd rather not do that (as users then have to update immediately after their commit, and it's not trivial to write) - I'm looking for a better alternative. Perhaps something with rewrite rules in the Apache server?

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-rewrite