|
Home > Archive > Web Servers on Unix and Linux > April 2005 > How to include html code...
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to include html code...
|
|
| Sébastien Roy 2005-04-23, 5:49 pm |
| 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
| |
|
| 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.
| |
| Nick Kew 2005-04-24, 7:46 am |
| 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
| |
| Sébastien Roy 2005-04-24, 2:48 pm |
| Nick Kew wrote:
> Sébastien Roy wrote:
>
>
>
>
> 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
| |
| David Efflandt 2005-04-24, 2:48 pm |
| On Sun, 24 Apr 2005, Sébastien Roy <sebastien@pointpub.net> wrote:
> Nick Kew wrote:
>
> 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.
|
|
|
|
|