Forum OpenACS Q&A: Re: what is a .vuh file

Collapse
4: Re: what is a .vuh file (response to 3)
Posted by Roberto Mello on
A .vuh is a Virtual URL Handler file, and it's OpenACS specific. The request processor looks for a .vuh in a page's directory when it can't find a certain page (AFAICR).

in a .VUH you can do processing, URL rewriting (for pretty URLs), redirection, etc. See the rp_internal_redirect and the rp_form_put (IIRC) procs in the api-browser.

I don't remember if .vuh's are handled in ACS Classic Keith. Also, you might want to take a look at Til's Redirect package.

-Roberto

Collapse
5: Re: what is a .vuh file (response to 4)
Posted by Randy O'Meara on
Keith,

Here are a couple of threads that discuss the use of index.vuh. They may be helpful in understanding and actually using this facility.

http://openacs.org/forums/message-view?message_id=121704
http://openacs.org/forums/message-view?message_id=115061

Keep in mind that the request processor (RP) serves up an index.vuh as a last-ditch effort. So, you can't have an "index" file in any of the standard places that the RP looks while resolving a request to a concrete file. For example, if you wanted to use an index.vuh file on the root of your service (/www) then you must be certain that you've moved packages/acs-subsite/www/index.* and /www/index.* out of the way first.

BTW, this is really a slick way to do anything that can be scripted in place of the standard tcl/adp or .html service. You can even do all of your scripted processing and then internally redirect (the user's browser does not receive a redirect response) *after* stuffing whatever values you want into the query var structure. These modified, or additional, query vars are available to the page that is the target of the internal redirect.

Another use would be to do some common processing on *every* page request within a package (or even the entire site, or a subsite).

Check out the edit-this-page package. It uses and index.vuh.

I believe openacs.org also makes use of an index.vuh to publish content on its front page. The openacs.org site is available in CVS.

Randy