0

If I have a website that hosts 5-10 static pages, and all of them have the same basic layout but different content, what is the best way to configure them to all update simultaneously?

Ex: Every page on my website has a header and footer. I want to add a link to the header. How do I do this without having to update all the pages individually?

  • There are a lot of ways to do it. Are you leaning towards a content management system like WordPress or leaning a programming language like PHP? – Stephen Ostermiller May 6 '17 at 2:27
2

I am assuming you got simple static HTML files.

Convert all HTML files into PHP files.

Identify common content in header and footer and put into separate php files like: top-header.php footer.php etc.

Now, remove common header and footer content from each file and just call header and footer php files like:

Now, if you update a link in the header file it will automatically show on all pages.

Note: If you got live pages then ensure all those HTML redirects to respective PHP files and it should be permanent 301 redirects.

  • Do I have to use PHP or can I use something like Node.js or Apex? Also, how would this affect Google Search Ranking? Thanks. – FrostyTigerXP May 6 '17 at 21:12
  • This is doable with any server-side scripting language such as PHP and asp. If you use client-side languages, then it may confuse search engines if all code is embedded into the HTML itself, or if you call the script externally from the HTML then there will be some slowdown on the client since the client browser will have to request the script file as well to complete the page load. – Mike May 7 '17 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.