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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
AlanG
Forum Contributor
Posts: 136
Joined: Wed Jun 10, 2009 1:03 am

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

Post 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.
Post Reply