How to include html code...

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


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-23-2005
Sébastien Roy
 
Posts: n/a
Default How to include html code...

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
  #2 (permalink)  
Old 04-24-2005
paz9
 
Posts: n/a
Default Re: How to include html code...

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

  #3 (permalink)  
Old 04-24-2005
paz9
 
Posts: n/a
Default Re: How to include html code...

Actually just saw another post that helped me get it working:

DirectoryIndex index index.html whatever.html

I added this inside of the VirtualHost or whatever directive and
restarted.

  #4 (permalink)  
Old 04-24-2005
Nick Kew
 
Posts: n/a
Default Re: How to include html code...

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
  #5 (permalink)  
Old 04-24-2005
Sébastien Roy
 
Posts: n/a
Default Re: How to include html code...

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
  #6 (permalink)  
Old 04-24-2005
David Efflandt
 
Posts: n/a
Default Re: How to include html code...

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.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0