[Apache] Ads op site forceren

Pagina: 1
Acties:

  • pierre-oord
  • Registratie: April 2002
  • Laatst online: 16-08 20:53
Voor sommige mensen wil ik wel wat webruimte met PHP ondersteuning beschikbaar stellen op mijn server. Genoeg voor bijvoorbeeld wat foto's enzo voor een excursie van school.

Nu wil ik wel een bannertje of een dun frame hebben op die site met ietse erin dat laat zien dat ik ook heb geholpen zegmaar, wie wil nou niet patsen :P

Nou, eerste idee was dit:
Ik maak een index pagina. Die linkt door naar de index pagina in de dir waar de site van diegene staat, met een tijd van 3 seconden waarop staat waar de server staat enzo. Probleem: Ik heb die index staan in www.iets.nl/index.htm zegmaar, en de site kan iemand uploaden in www.iets.nl/site/index.htm. Maar als mensen nu gewoon in een honderden TK domeinen de index van /site opgeven is het natuurlijk snel afgelopen...

Ik wil iets naar het idee van tripod en andere webhosters, die standaard een frame openen op iedere pagina dus.

Ik heb gegoogled, search hier gebruikt, maar kan echt _niks_ vinden over een manier om dit te forceren. Ik heb een kleine kennis van de PHP basics, maar ik het zo'n gevoel alsof je daar ook niks mee bereikt, het is tenslotte ook net html, want dat is de uiteindelijke uitkomst. Ik draai Apache 2 & PHP. Mysql wil ik er nog eens aan toevoegen, dus als dat nodig is.

Het lijkt een beetje een script-request op deze manier, maar ik wil er graag tijd insteken hoor!

Ondernemer in tech (oud LOQED.com, nu UpToMore.com)


  • Yoeri
  • Registratie: Maart 2003
  • Niet online

Yoeri

O+ Joyce O+

(overleden)
in elke degelijke webserver kun je naar mijn mening een header / footer instellen (in IIS in ieder geval wel :p), die header of footer wordt dan voor elke geservede pagina verwerkt

Kijkje in de redactiekeuken van Tweakers.net
22 dec: Onze reputatie hooghouden
20 dec: Acht fouten


  • faabman
  • Registratie: Januari 2001
  • Laatst online: 08-08-2024
in iis kan je bij mijn weten een standaard footer aan een site toevoegen, ik neem aan dat dat ook wel kan in apache

edit:
te laat :+

[ Voor 11% gewijzigd door faabman op 29-10-2003 13:22 ]

Op zoek naar een baan als Coldfusion webdeveloper? Mail me!


  • RM-rf
  • Registratie: September 2000
  • Laatst online: 11:47

RM-rf

1 2 3 4 5 7 6 8 9

dit is een Apache specifieke vraag (dus SA was een betere plek geweest deze vraag te stellen), je kunt je webserver zo configureren dat hij automatisch bepaalde bestanden included
volgens mij mbhv filters en mod_include:
http://httpd.apache.org/docs-2.0/filter.html

[ Voor 13% gewijzigd door RM-rf op 29-10-2003 13:25 ]

Intelligente mensen zoeken in tijden van crisis naar oplossingen, Idioten zoeken dan schuldigen


  • Bosmonster
  • Registratie: Juni 2001
  • Laatst online: 29-08 19:47

Bosmonster

*zucht*

Yup. de enige manier om hier wat aan te doen is met serverinstellingen.. dus

move W&G -> SA

  • G33rt
  • Registratie: Februari 2002
  • Laatst online: 22-06-2022
Ik denk dat je wel iets aan An Introduction To Server Side Includes zult hebben :)
To permit SSI on your server, you must have the following directive either in your httpd.conf file, or in a .htaccess file:

code:
1
Options +Includes


This tells Apache that you want to permit files to be parsed for SSI directives. Note that most configurations contain multiple Options directives that can override each other. You will probably need to apply the Options to the specific directory where you want SSI enabled in order to assure that it gets evaluated last.

Not just any file is parsed for SSI directives. You have to tell Apache which files should be parsed. There are two ways to do this. You can tell Apache to parse any file with a particular file extension, such as .shtml, with the following directives:

code:
1
2
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml


One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to change the name of that page, and all links to that page, in order to give it a .shtml extension, so that those directives would be executed.
Syntax:
SSI directives have the following syntax:

code:
1
<!--#element attribute=value attribute=value ... -->


It is formatted like an HTML comment, so if you don't have SSI correctly enabled, the browser will ignore it, but it will still be visible in the HTML source. If you have SSI correctly configured, the directive will be replaced with its results.

The element can be one of a number of things, and we'll talk some more about most of these in the next installment of this series. For now, here are some examples of what you can do with SSI
Met name dit stukje zal voor jou erg handig zijn:
Including a standard footer

If you are managing any site that is more than a few pages, you may find that making changes to all those pages can be a real pain, particularly if you are trying to maintain some kind of standard look across all those pages.

Using an include file for a header and/or a footer can reduce the burden of these updates. You just have to make one footer file, and then include it into each page with the include SSI command. The include element can determine what file to include with either the file attribute, or the virtual attribute. The file attribute is a file path, relative to the current directory. That means that it cannot be an absolute file path (starting with /), nor can it contain ../ as part of that path. The virtual attribute is probably more useful, and should specify a URL relative to the document being served. It can start with a /, but must be on the same server as the file being served.

code:
1
<!--#include virtual="/footer.html" -->


I'll frequently combine the last two things, putting a LAST_MODIFIED directive inside a footer file to be included. SSI directives can be contained in the included file, and includes can be nested - that is, the included file can include another file, and so on.

[ Voor 93% gewijzigd door G33rt op 29-10-2003 15:08 . Reden: handige stukken uit de docs gequote ]

Pagina: 1