Forum Moderators: mack
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?
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]
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
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.
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.
"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?
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.
FYI, I seem to getting indexed deeper than I used to get.
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.
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.
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.