I am wanting to create a single file for my header (including menu) and footer so I don’t have to edit every single file. Eventually set up a mobile version of our site (including this info in case it is relevant to method).
From what I have read, the easiest way to have single header/menu/footer files is to use PHP and implement a 301 redirect in order to maintain SEO rankings.
Is this correct?
Our web hosting service has Apache handling (.cgi .pl .plx .ppl .perl .shtml).
3
Answers
You can look into a templating engine like Twig.
you can create a base template that includes the header and footer, and extend that in all your other templates to override the body
http://twig.sensiolabs.org/
Maybe I’m oversimplifying the problem, but can you not just write header.php and footer.php and just:
in header part you can write the navigation code and and save as header.php and same thing as footer.php what do you want to write in footer section and save and where do you want to include you can include as
content