Forum Moderators: open
I am developing a website that is very database driven. I am well aware of the problem of dynamic pages and search engines.
What I propose to do is generate a series of static webpages automatically from within PHP. The pages will more or less be the same, except I will feed a different product ID into each static page I create.
Say I am creating a website on hotels, I would have several a directory for each city (ie, /boston, /chicago) etc... Then I would have a series of pages in each directory (ie, /chicago/sheraton_1.php).
Obviously, this is going to increase the size of my files, but surely it will help in the search engine battle?
My main question, is can I still make the pages dynamic, in that the PHP for each hotel page will just contain a function like get_hotel_data($hotel_no) which pulls the relevant data from the database. Or, will the search engines see the .php extension and know that the page is really dynamic.
Thanks
For example, if you hit the refresh button on one of your dynamic pages and the contents change each time you hit refresh, then you probably won't do well in the search.
To manage a site like that you should use as many includes as you can. It will make your life much easier later on.
If you want to get best results, you could either export all pages to static HTML pages (this helps a lot when having lots of traffic, because for the page serving you don't even need the PHP processor). You can export the pages as often as you like (provided that your server still has some load left).
Or leave the PHP serving the pages, but rewrite them (apache mod_rewrite) to HTML pages. This way no one can even suspect your pages are dynamically generated.
Could be that it doesn't make a big difference (extension php or html), but I would play safe if I had the time.
All functions/includes are process during the build process thus your pages are purely static aside maybe from ad/news function calls.
Benefits
1. You don't have to serve dynamic pages everytime thus less stress on your server.
2. Search engine friendly and faster.
Disadvantages
1. Require a lot of server space in the long run
2. Depeding on your scripting skill, lot more harder to maintain as opposed to a purely dynamically served page.
The only area where you have to serve dynamic page is your search page that is if you want a search function as well.
Cheers
Or leave the PHP serving the pages, but rewrite them (apache mod_rewrite) to HTML pages. This way no one can even suspect your pages are dynamically generated.
the fact that you are using PHP will be announced to the world in every header sent back on a GET request
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26\r\n
X-Powered-By: PHP/4.1.2\r\n
On Apache this info will be sent back by default. I don't know about IIS or others, but I suspect they are the same.
On my Apache setup this is what will be sent back:
Server: Apache\r\n
Notice that the "Server:" line only reports that it is Apache and that the "X-Powered-By:" information is not sent at all.
In Apache the following line in httpd.conf will do the trick:
ServerTokens Product
As phpmaven states YOU are in charge which headers your server sents back (at least with apache), you if you invest a little time even Googlebot will think that you update your "static" html pages every hour and be very very impressed by this :)
Btw, just look at WebmasterWorld.
YOU are in charge which headers your server sents back (at least with apache)...Googlebot will think that you update your "static" html pages every hour