Answer the question
In order to leave comments, you need to log in
Is there such a CMS for a static html site?
There are static sites in html. Is there a CMS that can simply be uploaded to the root of the site, or does it convert the site into the format it needs and allows you to install traffic counters on all pages of the site and insert adsense ad units in the text according to the specified parameters. For example, after the title, after the first picture, etc.?
Answer the question
In order to leave comments, you need to log in
perhaps SSI (in particular the directive <--#include -->
) will help you
Make a routing in .htaccess to your insert_ad.php script, to which you pass the name of the requested html file as a parameter:
The script reads the file, inserts what is needed where it is needed, and voila - gives the client an output with advertising.
if ( $file == '' ) $file = 'index.html';
$input = file_get_contents( $file );
$insert_this = '<div id=ad>...</div>'; // Например вставляем это
$marker_before = '</body>'; // перед вот этим
$position = strrpos( $input, $marker_before );
echo substr( $input, 0, $position ).$insert_this.substr( $input, $position );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question