This is a discussion on How to include html code... within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi folks, Anyone know how to tell apache (2.x) to load a .html file before loading any others files ? ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi folks,
Anyone know how to tell apache (2.x) to load a .html file before loading any others files ? For example, I would like to execute loader.html or loader.php before any other .html / .php file. Like if a user create a index.html I want to execute loader.html before index.html. And samething if the user create a something.html page. But only for a specific virtual host. Thanks Seb |
|
|||
|
Oh, I have a similar, yet much simpler problem (simpler, that is, for
someone who actually knows what they are doing :) ). My web site is working but only if I type "/index.htm" at the end of the name. How do I get apache to just pick up this file as the default? The Linux GUI says it is doing that, but I don't see any corresponding directive in the httpd.conf file. Thanks in advance... Pasquale |
|
|||
|
Sébastien Roy wrote:
> For example, I would like to execute loader.html or loader.php before > any other .html / .php file. Like if a user create a index.html I want > to execute loader.html before index.html. And samething if the user > create a something.html page. But only for a specific virtual host. Erm, english isn't your native language, right? I'm guessing you mean you want to include some HTML fragment in every page. The conventional way to do that is server side includes (SSI). If you want to do it without SSI, there's an example at http://apache.webthing.com/mod_publisher/macro.html -- Nick Kew |
|
|||
|
Nick Kew wrote:
> Sébastien Roy wrote: > > >>For example, I would like to execute loader.html or loader.php before >>any other .html / .php file. Like if a user create a index.html I want >>to execute loader.html before index.html. And samething if the user >>create a something.html page. But only for a specific virtual host. > > > Erm, english isn't your native language, right? > > I'm guessing you mean you want to include some HTML fragment in every > page. The conventional way to do that is server side includes (SSI). > If you want to do it without SSI, there's an example at > http://apache.webthing.com/mod_publisher/macro.html > You're right about my native language. Sorry. I know about SSI but I can't use that. I want to do like Geocities stuff. They have a banner in every page without modifying the user code. I check mod_publisher but I can't download the source to compile it. Thks Seb |
|
|||
|
On Sun, 24 Apr 2005, Sébastien Roy <sebastien@pointpub.net> wrote:
> Nick Kew wrote: >> Sébastien Roy wrote: >> >> >>>For example, I would like to execute loader.html or loader.php before >>>any other .html / .php file. Like if a user create a index.html I want >>>to execute loader.html before index.html. And samething if the user >>>create a something.html page. But only for a specific virtual host. >> >> >> Erm, english isn't your native language, right? >> >> I'm guessing you mean you want to include some HTML fragment in every >> page. The conventional way to do that is server side includes (SSI). >> If you want to do it without SSI, there's an example at >> http://apache.webthing.com/mod_publisher/macro.html >> > > You're right about my native language. Sorry. > > I know about SSI but I can't use that. I want to do like Geocities > stuff. They have a banner in every page without modifying the user code. > > I check mod_publisher but I can't download the source to compile it. See apache docs for 'Action' directive. It can run a CGI (as handler) for static content. However, it is up to your handler CGI to include proper Content-type header and the originally requested content within whatever you wrap around it. The requested URI path is passed in script env as PATH_INFO and system path of requested resource is passed in PATH_TRANSLATED. For example, I have used an Action handler to do a dynamic top of page, then sidebar menu and requested content in a table, then a footer. |