Link to home
Start Free TrialLog in
Avatar of Sudaraka Wijesinghe
Sudaraka WijesingheFlag for Sri Lanka

asked on

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 asp.net 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?

Thanks.

P.S.
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)
Avatar of caterham_www
caterham_www
Flag of Germany image

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)$">
SetHandler asp.net
</FilesMatch>
Avatar of Sudaraka Wijesinghe

ASKER


Thanks for the reply caterham_www
but no luck, mod_aspdotnet doesn't seem to work with the method you mentioned.
Avatar of periwinkle
Is there an AddHandler command for .php files?  What happens if you swap the order of the ASP and PHP handlers?
Nope, there's no AddHandler for .php
ASKER CERTIFIED SOLUTION
Avatar of sleep_furiously
sleep_furiously

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks sleep_furiously,

Your solution answer helped me to resolve this problem.