All my contents are saved in my MySQL database and each page is listed as something like

filename.php?Pageid=1

In the past, all my files in HTML can be easily searched by google from their keywords explicitly expressed in HTML codes, but now, since all contents are saved in MySQL database, google cannot find these keywords. My ranking in google goes down too.

How do you guys deal with this problem? Many thanks.

    OK a few things... first off, if by 'keywords' you mean <meta> tag keywords, you should konw that Google DOES NOT look at <meta> keywords tags. <meta> description maybe, but not keywords.

    Is the problem that Google cannot find those keywords, or that those keywords simply arn't listed at all on your pages?

    Google tends to prefer pages WITHOUT query strings, ie without ?PageID=1.

    With a little help from Apache you can change those to look like directories, making this:
    /filename.php?Pageid=1

    Into this:
    /filename.php/Pageid/1

    Or even:
    /filename/Pageid/1

    Or possibly:
    /filename/1

    If the problem is just that you don't have unique <meta> description, title tags and stuff on each page, why not make a MySQL table of pages, each with their own description adn title?

    PageID, meta_keywords, meta_descrip, title_tag

    1, "custom caps, customized caps, custom hats", "Your One Stop Shop For Custom Hats!", "MyWebsite.com :: Custom Hats"

    Then have your header file pull that info ( based on PageID variable ) from that table and fill in those keywords and description and title differently on each page?

      Oh, I am not meaning keywords in meta, I mean the words in my content. You are right google won't look at the query part, that is
      '?pageid=1' part. They only look at filename.php

      So, how do you change from filename.php?pageid=1
      to /filename.php/1 ?

        Apache ForceType or mod_rewrite

        ForceType is usually the easier method, put this in your .htaccess file or config, whichever you have permission to change...

        <FilesMatch "name_of_file$">
        ForceType application/x-httpd-php
        </FilesMatch>

        Name your file 'name_of_file' WITHOUT an extension. Should work after that, EXCEPT that you need to parse the PHP variable QUERY_STRING or REQUEST_URI to get the Pageid variable out of the string. I'll leave that up to you. Oh, and make sure to change all your href=" links too.

          10 days later

          Apache ForceType or mod_rewrite

          Hey I'm doing this same thing and have the .htaccess file working.
          I'm not sure how to parse my querystring as you mention below...

          "you need to parse the PHP variable QUERY_STRING or REQUEST_URI to get the Pageid variable out of the string..."

          Do you have any PHP examples, or can you point me in the right direction. I understand the basic concept but am unsure of how to do this with multiple variables...

          Basically my querystring looks like this:
          http://www.antosart.com/sha/about.php?section=sha_about&url=1

          Then I step through the content by incrementing the url variable
          http://www.antosart.com/sha/about.php?section=sha_about&url=2 and so on...

          Any idea on how to make this work with the "Clean URL" .htaccess file?

            To parse the querystring, you just need to explode() the query string by / and assign even values of the explode() to keys, with the next one being the value...

            Soo...

            $_SERVER['REQUEST_URI'] = "/index.htm/var1/value1/var2/value2";

            $explode = explode ($querystring, "/");

            $_THINGS = array ();

            foreach ($explode as $key => $value) {
            if (($key % 2) == 0) {
            $_THINGS[$key] = $explode[$key + 1];
            }
            }

            Just make sure that you don't end up with a querystring like this:
            /var1/var2/value2

            Or it'll screw up. Play with it, its not very difficult.

              Write a Reply...