Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm aware that you can configure by file type (first line below) but i'd like to be more specific. I tired the 2nd line below, but didn't seem to work. Am I doing something wrong?

#AddHandler server-parsed .html
# Would like to only parse *.dyn.js, instead of all *.js files 
AddHandler server-parsed .dyn.html
share|improve this question

1 Answer 1

up vote 1 down vote accepted

It is not how you should do it. Here's why: according to the mod_mime documentation, apache treats the all of the sections of the filename which begin with dot as an extension. In the example you provided, if you have a file, say, default.dyn.html, it is treated as a .dyn and as a .html file simultaneously. If simultaneous handling happens to be impossible, apache processes the extensions from right to left. So, you can't define an "extension" which contains a dot.

What you should do instead, it to define the "server-parsed" handler for the .dyn extension only. In this way, if you have a .dyn.html file, it will be registered to the server-parsed handler and to the text/html mimetype. Since these can coexist nicely, the file will be parsed, and will be served as an html page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.