Forum Moderators: mack

Message Too Old, No Replies

Dynamic v. Static Pages

Newbie Question

         

Gruntled

4:29 am on Feb 11, 2005 (gmt 0)

10+ Year Member



I've been lurking on this site for a few days and had to finally join and post a question because I am so impressed with the generosity and enthusiasm (and knowledge!) of the participants. Thanks in advance for your help.

I am not new to programming html pages, but I am brand new to website development, marketing, etc. I am starting a new site and intend to slowly build quality content over time. I would prefer to just go ahead and input that content into my pages now, which I can do if I just lay out a bunch of static pages. Is this course of action adviseable? Or, do you think I'd be smarter to hold off on my content while I learn how to work PHP/MYSQL? Bear in mind that I don't do this full time--I have a job and a family. Does a site crammed with static pages attract more traffic?

mack

10:32 am on Feb 11, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



This can be a tricky call.

The main advantage of dynamic over static is that you can easily change elements later without having to manualy change each page. If you intend to grow a large site I would say dynamic is the way to go.

For smaller sites I almost, always use static html pages.

In terms of using php mysql you can also use text files as opposed to an mysql database, although I guess you would be better to try and get to grips with mysql as you build your site.

With a recent site I cheated a little and used text files to hold my formated html. It was then a case if having each page build like this.

This is index.php....

<php?
include "header.php";
include "index.txt";
include "footer.php";
<?

This allowed me to change the header and footer files easily. It also let me edit the text files one at a time if I needed to change content.

Mack.
[edit for typo]

[edited by: mack at 10:56 am (utc) on Feb. 11, 2005]

jamie

10:45 am on Feb 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi gruntled,

if you already 'know' html than learning enough php to be able to help with site maintenance (like mack explains) will be relatively easy and can greatly help.

this post from the php library is a good starting point
[webmasterworld.com...]

good luck

Gruntled

4:30 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



Thanks to both of you. I'm definitely thinking that I'll need dynamic pages at some point. I can't imagine going through a thousand pages and changing the site navigation areas on all of them. For now, I'm just too excited about getting my content up on the web to mess with the learning curve for dynamic pages. I'm sure that, once the site gets too cumbersome, I'll learn what I need to know and change everything over.

Any thought on how the use of one or the other affects a site's popularity? The Google site says it can spider dynamic as well as static pages, but I'd be interested to know what peoples' experiences are.

Gruntled

4:34 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



...on second thought, jamie, the info at the link you sent me makes it look so simple, I may just have to try it now. Thanks!

incrediBILL

4:46 pm on Feb 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Gruntled,

I will tell you this from my own personal experience of running a dynamic site, it can rank very high. Static or dynamic, your page has to highlight the relevant content and generate a relevant page title or it will falter.

Also, use static URLs that link into the dynamic site, it helps further indentify the content matter relevance. By static URL I mean a placeholder page name like My-Buzzword-Keyword.html which does nothing but display a specific dynamic query. Not a redirect mind you, just an internal query that displays under My-Buzzword-Keyword.html so that nobody is the wiser about whether it's statis or not. That in itself surprisingly made a fairly significant difference.

Gruntled

5:13 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



Thanks incrediBill. A few follow-up questions:

"Also, use static URLs that link into the dynamic site..."

This isn't frowned upon by Google, etc.?

"...By static URL I mean a placeholder page name like My-Buzzword-Keyword.html which does nothing but display a specific dynamic query."

I've seen this syntax used on this site a lot. Are the dashes in the above URL example used for purposes of illustration on this site only, or should I really include them in the URL?

incrediBILL

1:49 am on Feb 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Actually, I include the dashes in the page name so the SE knows what words you mean. I use(d) underscores on my site until people told me those aren't word breaks, that dashes are, but it pushed my site to the top with underscores (as I didnt know for sure underscore vs. dash when I make the switch) so I'm not changing them.

Regardless, the outside world can't tell if my site is serving up dynamic content with a page name like "Blue-Wonder-Widget.html" when it serves up a page of dynamic blue wonder widget content. Sadly I started with "www.mysite.com?search=Blue-Wonder-Widget" and now all those lower ranking links are still stuck in the search engines and sometimes stopping "Blue-Wonder-Widget.html" from moving up the ranks. However, the older links are slowly fading away, just not fast enough.

The best bet is to do it right the 1st time, dont mess around from the start.

confused

3:20 am on Feb 12, 2005 (gmt 0)

10+ Year Member



Hello Everyone... I am also developing a new dynamic site and am implementing a static link... "blue-widgets" but instead of the .html extension it's .aspx Any thoughts as to what is best since the search engines don't really care what the extension is?

incrediBILL

4:15 am on Feb 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My site is actually .cgi and I used .html just to avoid giving any hint whatsoever to what technology the site runs. When you expose .php, .asp, .cgi, etc. you tell the search engines it's dynamic, in case the SEs penalize limiting the number of indexed pages, and you also give hackers a clue in case your technology has a current vulnerability like many PHP sites currently have. That made my decision easy to mask the technology using web server re-write rules to make it all appear as .html to the outside world.

FYI, I seem to getting indexed deeper than I used to get.

Gruntled

4:14 pm on Feb 12, 2005 (gmt 0)

10+ Year Member



Oky incrediBill, you continue to pique my curiosity every time you offer more info, and I appreciate it. It's become obvious to me that I probably need to go invest in a good, thorough, tutorial book on PHP (which, btw, I choose over PERL/CGI just because I have some limited familiarity with it). However, I am pretty confident that no such book is going to explain the trick of hiding the technology as you described in your last post. It might be explained pretty well somewhere else on this site--and I'll look for it--but do you know of any good sites that give away "hacks" like the one you describe?

Also, I still don't quite get the static URL thing you explained in msg#6:

Also, use static URLs that link into the dynamic site, it helps further indentify the content matter relevance. By static URL I mean a placeholder page name like My-Buzzword-Keyword.html which does nothing but display a specific dynamic query. Not a redirect mind you, just an internal query that displays under My-Buzzword-Keyword.html so that nobody is the wiser about whether it's statis or not.

The way I interpret this is, for example:
1. Home page is: www.widgets.com/index.php
2. I want to draw traffic from people searching for blue porcelain widgets with a Star Trek theme, so I createt the static page: www.widgets.com/blue-porcelain-star-trek-widgets.php, and on that page I have a dynamic query (which I assume automatically loads when the page loads) that brings up the relevant content--either from an include file or from a database?

Is this right, or am I way off base?

Thanks for your help.

incrediBILL

6:07 pm on Feb 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Gruntled,

You're basically on the right path.

In my configuration I have one master search page that handles all the nuts and bolts of the operations and a bunch of SE friendly page names as entry points into that datatabase search that do nothing but call the main search function passing the parameters needed to display the desired results for that page.

Hiding the technology wouldn't be a PHP trick, that's an Apach web server re-write trick. Browser makes a request for "Blue-Widget-Info.html" but they could get any technology behind the scenes as we translate the path to '/cgi-bin/blah.cgi/whateverpage.#*$!" in the background or in your case it would be "blah.php". Neither visitors nor search engines have any clue, they just see the page they asked for, not all the slight of hand being done.

The only drawback was when I upgraded to Apache 2.0 the behavior changed.

In Apache 1.x the web server blindly let me re-write the path and didn't validate "Blue-Widget-Info.html" actually existed so I cleanly had all requests, although looking like individual page requests being interpretted by a single page - "/cgi-bin/blah.cgi/showthedata.xxx"

In Apache 2.x the web server now INSISTS on validating that "Blue-Widget-Info.html" exists BEFORE it processes my re-write rule which really stinks. The only way to maintain the method I used in Apache 1.x was to redirect all 404 errors to "/cgi-bin/blah.cgi/showthedata.xxx". which sadly still reported a 404 so I abandoned that avenue. So I ended up writing a little script that generated a physical placeholder page for "Blue-Widget-Info.html" and all the rest. Not sure you would need to do these placeholder pages with PHP, but you might if you play with the re-write rules like I did.

Gruntled

3:37 pm on Feb 15, 2005 (gmt 0)

10+ Year Member



I don't know if anyone is still following this, but if they are:

Update: Thanks to the advice of the good people here, I have been able to put up 40 pages or so of content and my site is growing much more easily than it would have if I had used purely static pages. I'm only using PHP includes--not good enough yet to query databases, although I see that in my future.

Question: Now that I have some content and a reasonably well-organized site, I need to start thinking about metatags. My site is set up as a bunch of "static" php pages with includes for the header, footer and nav areas. I put the titles in my pages by defining variables on each page. This creates the <title> tag every time the header is called. Now, here's the quesiton: If I create my metatags the same way, will they work? IOW, my metatags would be defined as a variable on each page; and the actual <meta> tag would not generate until the header is called.