Page 1 of 1

SVN with Apache (Showing php files as php source files)

Posted: Wed Mar 17, 2010 7:58 am
by AlanG
Well the title pretty much explains it all. I am looking to show .php and .phtml files as .phps (of the SVN repository), but within the Apache Location directive. The problem is that Apache processes the FilesMatch directive before the Location one, meaning I need to do some kinda workaround.

Code: Select all

 
<Location "/svn">
    DAV svn
 
    SVNPath /home/alang/svn/repo
    AuthzSVNAccessFile /home/alang/svn/repo/.svnaccess
</Location>
 
<Directory "/home/alang/svn/repo">
    <FilesMatch "\.(php|phtml)$">
        ForceType application/x-httpd-php-source
    </FilesMatch>
</Directory>
 
I tried to use the Directory directive as a workaround but I'm afraid by skills with Apache configuration aren't anything spectacular.
The DocumentRoot is "/home/alang/webroot/site/public/" (just incase it matters).

Any help / insights would be greatly appreciated. :)

Update:

Just to note that the current configuration has no effect at all on the .php files. When accessed they are being selected for download.