There are many pages on the site, differ only in content. But if I want to change either the logo, or the menu, or say the basement, then I’ll have to change them on all pages, which in general is not very fun. I don’t want to use PHP in this project, are there any alternative ways to do this?

Made in javascript, for the first thing that came to mind. But then he doubted: would the site be indexed normally? After all, if you turn off the scripts, then the short information in the footer disappears and the links disappear?

    2 answers 2

    Try Server Side Includes ( rus ). This is a more lightweight version that is supported by all modern web servers. It will look something like this:

    <!--#include file="footer.html" --> 

    JavaScript should not be used: it will really interfere with indexing. Without server support and non-trivial gestures, such sites are not normally indexed.

    • well, why? Analyze the URL, load the desired Ajax-ohm + History API and it will be quite normal to be indexed. Although, SSI can also be called a way out in the same way as a vehicle. - Deonis
    • @Deonis How will Googlebot get your agiaks? He sees naked HTML, he does not give a damn about scripts. - Athari
    • search bots have long been able to work with Ajax. I say this from personal experience. I have a project that works entirely on Ajax. In Yandex and Google, all links sent to the map are perfectly indexed. With that, both the title and the meta-data of the pages change dynamically. Yes, the request is processed on the server, the data is taken from the database, but essentially it does not change. - Deonis
    • @Deonis Show the site something, which is "completely on the agax". - Athari
    • @Deonis Your site builds full HTML. You do not have a “site entirely on AJAX”, but a site with transitions between pages optimized using AJAX and the History API. If you disable JS (and hide the idiotic loader or just disable the styles), you will see full-fledged pages built on the server, along with all the menus and caps. Well, you reassured me. And then I was afraid that I missed how the search bots began to fully implement the JS. - Athari

    I have a principle - not to join holivary, even if I am sure I am right. But for those who will read this discussion in the future, I recommend reading the report of a series of tests on how Google indexes dynamic content , and in general, what Googlebot has a “relationship” with JS. This will help you not to pay attention to some screamers Alya @Discord and do not worry that using Ajax can cause poor site indexing. Those who have difficulties with English can read the translated article , although the original is original in Africa.