Aug
8

Static HTML vs Dynamic URLs for Search Engine Optimization

4

What’s a static HTML page?

The classic static web page is generated from an actual page ‘physically’ located on the server: so if you had a page named static-page.html somewhere on your server you could find and download this page (it exists, you could grab it via FTP).

The very first websites all used static HTML pages and so the first search engines cut their teeth on static web pages.

What’s a dynamically generated web page?

As the web developed a new way to generate websites arrived, dynamically generated web pages. They differ from static pages in that there is no ‘physical’ equivalent to the page you may be viewing on the server (so you can’t directly download it via FTP).

Dynamically generated pages in it’s simplest form is a single template page that’s used to generate an entire website (could be 1,000,000 page site). Since dynamic pages use scripting languages like PHP and ASP the template will be named after that language for example dynamic-page.php.

This one template page can then be used to create a theoretical unlimited number of unique (unique content) pages each with a unique dynamically generated URL. A simple example would be a 100 page site with each page generated with the format below-

dynamic-page.php?page=1
dynamic-page.php?page=2
dynamic-page.php?page=3
dynamic-page.php?page=4
dynamic-page.php?page=5


dynamic-page.php?page=100

None of the pages above exist ‘physical’, they are all generated from the single dynamic-page.php page using server-side scripting (PHP in this example). The content from each page could come from a MySQL database, updating the database also updates the website content. Editing the dynamic-page.php changes the entire site.

Many new to web sites looking to go dynamic become confused when they can’t find a page like dynamic-page.php?page=4 on their server (FTP) to edit and post to forums asking how to find them :-)

Why use dynamically generated content?

There are many benefits to dynamically generated websites, this site for example uses the WordPress CMS (Content Management System) which creates dynamically generated pages with a very easy to use back-end for adding and editing content on the fly (any fool can create a site using WordPress and many do!).

A user of WordPress types/pastes content into a text editor like web page (similar to Word), gives it a relevant title etc… clicks a publish button and within seconds the page is available on the website with links from any relevant sections automatically created. Add a new section to the site and the CMS automatically creates a link from the menu, so visitors to the site have immediate access to the new section.

This is just the tip of the ice berg of what’s possible with dynamically generated content, this site uses a WordPress plugin that automatically links phrases to a relevant page (the phrase “Text Links” automatically links to a relevant page and “SEO Consultant” to another page).

To do this with static HTML pages could involve hours of manual editing, though there are ways to simplify the process for example using server-side includes so the menu code (the menu links) are held in a separate file (edit one file, whole site updated). But even with includes and similar techniques static HTML sites (especially large sites) are far more time consuming to maintain than a well thought out dynamically generated site.

Now you know why smart webmasters use dynamically generated sites now we’ll deal with how the search engines, especially Google handle dynamic sites.

Search Engines and Dynamic Sites

In the early days Google etc… could only handle simple URLs like static-page.html and choked on URLs like dynamic-page.php?page=1.

As more and more websites went dynamic the major search engines played catch up, first being able to deal with simple constructs like dynamic-page.php?page=1 and later the more complex dynamic URLs like-

dynamic-page.php?section=SEO&page=1
dynamic-page.php?section=SEO&page=2
dynamic-page.php?section=SEO&page=3

In the example above we now have 2 variables, a section and a page.

Search engines like Google at first could only handle a small number of variables, wasn’t that long ago when Google would choke on 4 or more variables in a dynamic URL-

dynamic-page.php?section=SEO&sub=Spiders&Bot=Googlebot&page=1
dynamic-page.php?section=SEO&sub=Spiders&Bot=Googlebot&page=2
dynamic-page.php?section=SEO&sub=Spiders&Bot=Googlebot&page=3

And so it was advisable to limit the number of variables passed.

Right now Google and the other major search engines can handle multiple variable URLs, not unusual to find 4+ variables in an indexed page and so there is no SEO reason NOT to use dynamic URLs since they can and will be fully spidered and indexed just like any static HTML page.

That said there’s two reasons for avoiding dynamic URLs, the first isn’t a big deal, so I’ll deal with it first.

Dynamic Sites are Spidered Slower than Static Sites

Google in particular has made it clear dynamic sites are spidered slower than static sites. The reason for Google to do this are webmaster friendly (as I’ve recently discovered), dynamically generated sites can potentially have unlimited pages and so Google assumes a dynamic looking site (a site with URLs like dynamic-page.php?page=1) is big and slows the crawl speed. It does this to limit server load because if a dynamic site (any site) has millions of pages, Googlebot and the other spiders could cause the server to crash if they spidered too many pages at one time.

The above has happened to my server, I use many dynamically generated sites, one script in particular uses Amazon’s XML feed to generate an Amazon affiliate store with millions of Amazon products. I have quite a lot of these stores, so potentially tens of millions of pages spidered by Google etc…

I use something called mod_rewrite to convert dynamic URLs to appear static (an SEO technique) in a web browser or search engine spider, so to Google on my server it finds tens of millions of static looking pages which it spiders at full speed!

This has brought my server to it’s knees at times and I’ve had to take measures to slow Googlebot and other spiders!

For an average user though the slower spidering won’t impact SERPs to a great degree, your new pages may take a day or two longer to be indexed, but they’ll get there eventually and when indexed will gain what ever SERPs they deserve.

For this reason if you have a dynamically generated site that’s regularly indexed by Google etc… it’s wise to keep things as they are.

SEO Pros and Cons of Dynamic vs Static HTML

If you are starting a new site and want the most traffic out of Google etc… then filenames are important and static HTML pages are very easy to name for maximum SEO effect.

You create a new page and give it a filename like-

best-seo-filename-in-the-world.html

An equiveleint dynamic URL might look like-

index.php?page=best+seo+filename+in+the+world

or even-

index.php?page=1

To Google all are spiderable/indexed, but the first one is the best because Google takes all words it recognises from a URL and uses that in the rankings algorithm.

Google treats hyphens (-), plus (+), equal (=) and dot (.) as a word separator so it reads the URLs above as-

1. best seo filename in the world html

2. index php? page best seo filename in the world

3. index php? page 1

The first has 7 recognisable words and one (html) is wasted (and you don’t have to use html).

The second has 9 recognisable words and three (index php? page) are wasted.

The third has 4 recognisable words and all four (index php? page 1) are wasted.

Wasted meaning not part of the keyphrase this page is targeting.

As you can see the HTML version is the best because it is so easy to manipulate and the dynamic URLs can range from terrible to not too bad.

As an SEO consultant I want the most out of each and every page, so when I create a site I try to make all filenames SEO friendly, but I also like to use dynamic sites because they save so much time in managing content and this is where mod_rewrite rears it’s ugly little head!

Mod_rewrite an SEO Consultants Nightmare

The hours I’ve spent converting dynamic URLs into static looking URLs through mod_rewrite is my own little hell, one tiny mistake and nothing works! But get it right and you can convert ugly SEO unfriendly dynamic URLs into SEO friendly static like filenames that Google etc… loves.

Not going to try to explain in this article how to use mod_rewrite, so open up Google type in mod_rewrite and have fun

If you find mod_rewrite is beyond your skill set, take a look at WordPress CMS, designed as a blogging platform, but very easy to convert to a general CMS (the SEO Consultant Services site uses WordPress, just remove the monthly archive from the menu). Out the box WordPress creates dynamic looking URLs, but with a few clicks of a mouse they can be converted (easily) to the URLs you see with this site.

Note: mod_rewrite is for Apache servers only.

132 Comments to “Static HTML vs Dynamic URLs for Search Engine Optimization”

  • PoohBearPenguin September 13, 2013 at 2:42 am

    Hello,
    I am web developer. I am confuse whether to use AJAX or not. Many times i read AJAX should not be used for security concerns. Can you please help me in understanding how is it threat?
    Thanks,
    Ravs

  • Denali September 13, 2013 at 10:37 pm

    Many website mainly forum sites automatically generate .html pages after user enter some data to their page how it is possible ? It is not possible to create 1000 of pages without scripts.
    I see like this ../answers/2009/12/15/66330.html or something like this. How to write the script please help me I am waiting your answer.

  • Miguel M September 14, 2013 at 6:57 pm

    hi
    i want to send the value of a textbox in one html file to the another html file dynamically present with the calucutions i.e division?

    eg:
    suppose page1.html has the text box named as xxxx in this field we type give one number let be as 5,
    this number be should be calculated by 3 dynamically which is not seen any where in the screen
    the result shiould be displayed in another html screen using javascript

  • maskills24 September 15, 2013 at 4:09 am

    So here’s an interesting one. I have no idea if this is possible, but hopefully someone here knows of a way. I have a site I wrote in coldfusion. It’s written in this god-awful language because we have to run a proprietary third party client to manage member data. So programming the site in anything but coldfusion was unfortunately not an option. The page is built dynamically, with the menu, header, footer, and all content being included from the index file based on URL variables.

    There are, of course, plenty of things PHP can do that coldfusion can’t and I’d like to do some of these things on this site. So what I’m wondering is… is there any way I can get the PHP engine on the server to somehow compile .php files containing php code or preprocess them BEFORE my coldfusion engine includes the php file?

    Thanks for any help anyone can offer.
    To be perfectly clear, I’m not looking to change the site or reprogram anything that’s currently there. I just want to be able to include PHP code from a coldfusion file and have that PHP code somehow already processed by the time it hits the coldfusion.
    I have tried simply including a file containing PHP and the code comes out completely unparsed.

  • colingrillo September 15, 2013 at 4:45 pm

    I have successfully transformed the static website I built for my podcast (www.noformatpodcast.com) into a dynamic website in Dreamweaver (on a testing server for now). I have done this without having to learn PHP or MySQL really at all by using the “Database”, “Bindings” and “Server Behaviors” tabs in Dreamweaver. THE ONLY THING I AM NOT ABLE TO FIGURE OUT is how to get a page to generate dynamically when some one clicks a link using information about that link to create the page. For example, I have a grid of dynamically generated episodes on the index.php page. When someone clicks the link for, say, episode 55, I want it to load the episode page (which I have already created) and fill in the information from episode 55 such as date, title, blurb etc. If someone clicks the link for episode 43, I want THE SAME page to load and dynamically populate the the page with the info from episode 43. Is this possible to do with Dreamweaver’s GUI, or do I need to grow up and learn to actually code?

  • mitesh September 15, 2013 at 5:46 pm

    There are many different urls for posts on a forum. For instance, you can specify the post id in the url, or the forum and topic id, or add a variable to jump to a specific comment, etc… A search engine sees variables in the url as making the url a different url, so how do search engines index forums since there are multiple urls for posts?

  • stephen m September 15, 2013 at 6:46 pm

    How can you take a little bit of information and transform it into a lot of information?? It’s physically impossible for there to be different 20-character URL’s for every different 100-character URL. To me it kind of seems like trying to take a 200×200 image and upscale it to, I don’t know, 400×400 without any loss of quality.

    How do they work and what am I missing?

  • Franklin Bluth September 15, 2013 at 11:47 pm

    I’d like to learn how to do what’s on this website:

    http://www.tourfactory.com/

    in the tour search field if you input 602090 for example, you’ll go to a specific page and in the URL there’s some code with asp and such

    I suppose it’s asp programming or perhaps another programming language can do the process more easily.

    I appreciate any advice. thanks

  • radha September 16, 2013 at 6:49 am

    I want to dynamically check for initialized $_GET (their names and their values) variables from previous page/script, i am actually updating my pagination class and want to generate START, NEXT, PREV, LAST links dynamically but checking which variables are initialized and append those variable names in the links/url. (Hard coding a $_GET[‘xyz’] variable is not what i am looking for)..

    Please help!

    please help !
    There are two $_GET variables i am working on, 1st is ‘page’ (which specifies which page a user is currently on), 2nd one is ‘category’ (specifies which category user has selected), hence url formed is like this:

    xyzmyscript.php?page=2&category=fruits

    I want to dynamically (not hard code) store/process names and values of these $_GET variables. Any way around?
    Thank you JOHN S, your post just made my URL’s generation/working right.

  • Marlon P September 17, 2013 at 9:35 am

    i need a good virus killer/spyware killer plus the key/serial

  • Beavis September 18, 2013 at 7:11 am

    It is a CSS pre-purchased template and I am editing it for my High School newspaper, however I am having problems making the pictures in the content slider a link to the story. It already has a link on the slider but it is a text and I want the whole picture a link.

  • nitin September 18, 2013 at 8:02 pm

    Yesterday I clicked on Google —- It kept up loading up google one right after the other & I couldn’t stop or control it. I had to force my computer to shut down. If it means anything I have already slowed my mouse down.
    I did not double click it.
    I did not double click it.

  • kerrin marz September 19, 2013 at 5:41 pm

    I was just reading on wiki about the hardware infrastructure of google. It sounds ridiculously enormous! So could this be a possible threat? Or is google pretty much indestructible?

  • Jonathan September 21, 2013 at 4:14 am

    Is it necessary to add meta tags to every page of a website?

  • Minecraft 1.6.2 Tutorial September 22, 2013 at 9:55 am

    Cool blog! Is your theme custom made or did you download it from somewhere?
    A design like yours with a few simple adjustements would really make my blog
    shine. Please let me know where you got your design. Thanks a lot

  • borabora5524 September 23, 2013 at 10:45 am

    I set up a google voice number so that I can take business calls on my personal cell phone and have a separate voicemail for business calls. However, when someone calls my personal phone number (not my google voice number) it forwards them to my google voicemail. Is there a way to have only calls from my google number forward to my google voicemail?

  • Ray D September 23, 2013 at 4:18 pm

    Google plus won’t stop sending me email notifications if someone comments something on the same post as I do. It sends me emails all the time. Me seeing the little red notification in the corner is enough. How do I change google plus from sending these notifications to my email?

    10 points for best answer.

  • lildevilgurl152004 September 23, 2013 at 6:07 pm

    I am wanting to you google voice but I would like to know a little more about it. I want to know if someone calls my google number and I answer it on my cell phone will my cell phone company charge me for the minutes I use?

  • Minecraft Leads September 23, 2013 at 9:23 pm

    Your style is so unique compared to other people I’ve read stuff from.
    Many thanks for posting when you’ve got the opportunity, Guess I’ll
    just book mark this blog.

  • ScRSC September 24, 2013 at 2:13 am

    Ok hey guys, thanks for reading this post. now what I am trying to do is simply displaying 10 products from the table and if more than 10 products are shown it will then automatically add a new page with like.. a different ID in the url? Well anything really as long as it will generate the pages dynamically. Below is my current coding.

    $data = mysql_query(“SELECT * FROM products;”) or die(mysql_error());
    $id = mysql_query(“SELECT ID FROM products;”) or die (mysql_error());
    while($info = mysql_fetch_array( $data ))
    {
    echo ”;
    echo “”;
    echo ‘<a href="?page=products&uid='.$info['ID'].'"';
    Echo " “;
    echo “”;
    echo “”;
    Echo “Name: “.$info[‘name’] . ” “;
    Echo “Price: “.$info[‘price’] . ” “;
    echo “”;
    Echo “Please click the image for further info. “;
    echo “”;
    }
    echo “”

    ?>
    As the coding shows, it is simply displaying the entire table in the PHP, however the problem is that the table will simply continue for ever, until their is no more products!! If you don’t know how to automatically generate a new page then would it be a good idea to show row 1-10, 11-20, 21-30 in different pages. If so how would this be done? Oops, I forgot to mention that the user will access the next list of products, E.G 11-20 by clicking the next page button.

    Is it possible to use a get function to change the ID of the url when next page is clicked? then it will show the 11-20 results depending on the URL? eg products&id=2 therefore showing the next list of products? I am pretty confused hehe!:)
    Thanks, your knowledge is appreciated!:)

  • josh12rox September 24, 2013 at 6:03 am

    I am replacing an old MS/EI HTC implementation with something more standards based, but want to disrupt the existing code as little as possible. The existing app has a set of UI controls that are marked up as follows:

    The important part of this story is the ‘onselect’ attribute that I will need to evaluate.

    I am successfully parsing the app pages to find these ‘itemPickers’ and extracting the attributes I need to reconstruct the control without using the HTC file, but in order to make the control actually work, I need to be able to access that ‘onselect’ attribute as an expression and not just a string.
    Thx blessed_thang, but I think you have gotten the reverse of what I want to do. I am looking to parse the markup and extract the ‘onselect’ from the page and evaluate it, not write the string to the page.

    PS. This is client side JS, not server side. Is maybe the eval() function what I need?
    thx Richarduie, I think my backstory is confusing folks a bit. I am not trying to attach an onclick event to a div. Rather, I have some HTML markup that I don’t want to change on a line by line basis, and that HTML includes arbitrary JS expressions as attributes of div tags. I can parse the DOM to find these tags in the application and get their attributes as strings.

    …so my question really is, once I have the string representation of these arbitraty expression, how do I convert them back to expressions so my new event handler can use them?
    Thx Random Malefactor. I think this is going to fix me up well, though I have since been pulled off to other things. One minor add-on question…

    …what is the scope of eval();?

    …as an example…
    If I have:
    function someFunction(){

    }
    Thx Random Malefactor. I think this is going to fix me up well, though I have since been pulled off to other things. One minor add-on question…

    …what is the scope of eval();?

    …as an example…
    If I have:
    function someFunction(){
    thisObject = thisObjectWithAttributesDeclaredHere;
    eval(“alert(‘thisObject.firstAttribute’)”);
    }

    …I am going to get an alert box with whatever I have set as the first attribute of thisObject?

  • Ryan Z November 27, 2013 at 7:12 am

    A. Google’s board of directors becomes dominated by close friends and relatives of its top management.

    B. The price of wireless internet unexpectedly drops, so more and more people use the internet.

    C. Google announces a huge profit of $1 billion but everybody anticipated that Google would earn a huge profit of $1 billion.

    Any help is greatly appreciated.

  • dotcomsecretsx January 1, 2014 at 4:24 am

    Way cool! Some extremely valid points! I appreciate you writing this write-up
    and the rest of the site is extremely good.

  • projector home theater reviews March 4, 2014 at 3:56 pm

    Hi I am so thrilled I found your web site, I really found you by
    accident, while I was browsing on Google for something else, Anyways I am here
    now and would just like to say thanks for a incredible post and a all round exciting blog (I also love the theme/design),
    I don’t have time to read it all at the minute but I
    have saved it and also added your RSS feeds, so when
    I have time I will be back to read much more, Please do keep up
    the superb jo.

  • Jamison@PlayersBlueprint.com June 20, 2014 at 10:29 pm

    Thiis paragraph will help the internet people for setting upp new website or even a blog from stzrt to end.

  • Sandra@Dean Clarkson June 22, 2014 at 7:52 am

    Howdy! This post could not be written much better!
    Looking through this article reminds me of my previous roommate!
    He constantly kept talking about this. I’ll send this article to him.

    Fairly certain he will hasve a great read. Thanks for sharing!

  • Corina@how to attract women June 24, 2014 at 2:03 pm

    I’m extremely impressed with your writing skills as well aas
    with the layout on yokur blog. Is this a paid theme or did you
    customize it yourself? Either way keep up the excellent quality writing, it’s
    rare to see a great bllog like this one nowadays.

  • Jeanette@www.rottentomatoes.com June 25, 2014 at 4:16 pm

    Thus, companies can take their business ahead of the competitors.
    Opera Mobile has become the browser of choice for the majority of Win – Mo users in this time, to the point that the majority of mobile phone providers
    supply Opera pre-packaged. So, in the war between smart phone and functional machine, smart phone is not certain to win the
    battle.

  • Evelyn@overstock coupons July 2, 2014 at 11:03 pm

    Right now, Staples discount codes can also get you
    up to 60 percent off on clearance items so you can save big
    on your office organization project. Without having to pay any fees or register to use the coupons, you can start saving on the 10 must-have
    items you’ll need for your new furry friend. These supplements are designed to provide people with that missing zest and energy for their
    life.

  • Johnny@San Diego SEO July 3, 2014 at 12:41 am

    Be wise and opt for a genuine SEO company wwho keep thheir word.

    They offer a variety of ervices by teaching and bby
    doing. When they discover the sought content, tjey are unlikely to explore another posting,
    which has been optimized for different keywords.

  • Donette@Players Blueprint July 9, 2014 at 12:09 am

    Howdy! This article could not be written much better!
    Looking aat this article reminds me of my previous roommate!

    He continually kept preaching about this. I’ll forward
    this post to him. Pretty sure he’ll have a very good read.
    Thank you for sharing!

  • Alejandra@prefinished wood floors July 9, 2014 at 9:28 pm

    Having read this I believed it was very enlightening.
    I appreciate you taking the time and energy to put this short article together.

    I once again find myself spending a significant amount of time both reading and commenting.
    But so what, it was still worthwhile!