The index page is in PHP, and I am about to create additional pages. Wondering whether they should be in PHP or HTML?
If the file is created in PHP, it would have the benefit of calling other files(like header.php in which I intend to use the google analytics and other code) by using the following code:
<?php include 'header.php'; ?>
The benefit is that the browser will cache it.
If created in HTML, the code may have to be input in each page individually and might increase the page load speed.
Is all this right?
And will there be any adverse SEO effects for using PHP?
I don’t think Search engines care whether it’s html or php page. In the past they didn’t tend to understand the variables on a dynamic (php) page but look at amazon or ebay etc and they are full of variables and still get searched.
It’s probably more for users but you can also create ‘clean’ urls where the variables are part of the url
www.example.com/page/1
Note you can even code it to remove the .php part.
You can even get the server to treat ,html pages as .php pages if you really wanted to. But i prob wouldn’t do that.
Alternatively you could get really clever and create dynamic pages which are processed and cached in a database so only the cached complete version is shown to users, which is what a lot of the cms systems seem to do. But probably overkill if you are not doing loads of queries.
If i was you i’d use PHP pages as you can do as you mention and include other parts into the page etc and create dynamic content. Just follow usual SEO advice and you’ll be fine
That is not my understanding of how PHP Includes work. The PHP is processed on the server side, and the complete page is served to the browser. The browser does not know that parts of the page were inserted using PHP; it just sees the complete page and will cache the page as a whole.
Using PHP includes is useful for coding because if you make a change to a common area of the site, such as the header, you need only update the one include file, not every single page. For this reason, I’d recommend using PHP for all pages. Whichever you choose, I’d say stick to one or the other; don’t mix and match.
There are no adverse SEO effects from PHP. Googlebot will see the same parsed version that browsers see. If you are dynamically creating pages, then be careful of URL structure, as Noppy says. https://support.google.com/webmasters/answer/76329?hl=en