Forum Moderators: open

Message Too Old, No Replies

Dynamic Webpages - What about this?

         

MilesDependent

3:18 am on Oct 5, 2003 (gmt 0)

10+ Year Member



Hi

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

benihana

11:16 am on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the search engines dont care what the extention is, or if your pages are dynamic. problems arise when parameters are passed in the url to pull the required information out of db or whatever.

too much information

12:17 pm on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a few sites set up similar to what you are describing and Google has no problem crawling the pages. What you need to be careful with is that your pages do not change each time they are loaded.

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.

dirkz

12:37 pm on Oct 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

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.

plasma

3:46 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



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.

Yep, my suggestion too.
More flexible than file-export.

Net_Wizard

4:40 pm on Oct 7, 2003 (gmt 0)



If we are talking thousand of thousands of pages...the best way to do it is to create a php script that would 'build' static html pages thus you only build it once in a while or you only build it when the information have change.

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

dougmcc1

9:33 pm on Oct 7, 2003 (gmt 0)

10+ Year Member



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.

I was told in this thread [webmasterworld.com] that:

the fact that you are using PHP will be announced to the world in every header sent back on a GET request

Whatever a "GET request" is...

phpmaven

4:07 am on Oct 8, 2003 (gmt 0)

10+ Year Member



When a Browser or a spider requests a page from an server some of the headers that will be sent back will like the following:

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

dirkz

6:36 am on Oct 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



@dougmcc1:
The protocol that is used by your browser to surf pages is called "HTTP", and the way to display a page is to request it by the WWW server. This request is called a "GET" request, because the line (simplified) "GET /" is sent by the browser to the server, and the server answers with some header lines (all plain ascii) and then after some specials character with the body (the html page or other stuff).

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.

dougmcc1

2:37 pm on Oct 8, 2003 (gmt 0)

10+ Year Member



Thanks for clearing that up for me.

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

So by changing the header information that is sent back to the spider, it will think the page has changed as well? Also, how do you get the server to return different headers to the spider with each visit without changing the httpd.conf file each time?

dirkz

4:32 pm on Oct 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't get me wrong: You never should trick a spider by returning a wrong last-modified header if you page hasn't changed.

I meant that if you do it properly really no none from the outside can tell whether the page was dynamically generated.