Suppose you have a domain that is pointed to your server's IP. As soon as it reaches your server's IP you use Apache to point it to a DocumentRoot (in a VirtualHost).

But instead of pointing it to a document root, can you point it to a script? I want the script to control what is displayed on the web, not the DocumentRoot.

1 Answer 1


Given that you're referring to Python you can probably achieve what you want by using a WSGI Python script and connect that to Apache through mod_wsgi's WSGIScriptAlias. Most WSGI middlewares provide some kind of router functionality that you can use to select, based on URL prefixes and other parameters, what to display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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