Issue with AddHandler and file names

I recently installed the mod_aspdotnet on my Apache server, which required to ad the followin line to httpd.conf

AddHandler asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo

On the same server I'm also running PHP based web sites, on one of the php sites I have spme pages that names as "section_name.config.php". Problem is that Apache treat this page as an ASP.Net .config file and use the ASP.Net module to process it.

Does anyone else had a similar issue, and maybe has a solutions or workaround?


I know that if I move the AddHandler from main configuration in to a VirtualHost it would work in my scenario, but I need to figure out more stable solutions because I suspect that even on the same ASP.Net web site if I have page nameed "section_name.config.aspx", server might mistreat it as a .config (Haven't tested it though)
LVL 18
Sudaraka WijesingheWeb Application ProgrammerAsked:
Who is Participating?
There is no AddHandler for .php by default, but one can be used.  You can try replacing your AddType line:

   AddType application/x-httpd-php .php

with (php4):

   AddHandler php-script php
   AddType text/html php


   AddHandler php5-script php
   AddType text/html php

You probably want to put this AddHandler after the one for aspdotnet.

You might try the filesMatch directive

<FilesMatch "\.(asax|ascx|ashx|asmx|aspx|axd|config|cs|csproj|licx|rem|resources|resx|soap|vb|vbproj|vsdisco|webinfo)$">
Sudaraka WijesingheWeb Application ProgrammerAuthor Commented:

Thanks for the reply caterham_www
but no luck, mod_aspdotnet doesn't seem to work with the method you mentioned.
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Is there an AddHandler command for .php files?  What happens if you swap the order of the ASP and PHP handlers?
Sudaraka WijesingheWeb Application ProgrammerAuthor Commented:
Nope, there's no AddHandler for .php
Sudaraka WijesingheWeb Application ProgrammerAuthor Commented:
Thanks sleep_furiously,

Your solution answer helped me to resolve this problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.