We recently had a discussion in the office of what the best way is to optimize .php pages for the Search Engines. Anybody out there with any good ideas?
I have some experience with SEO (Search Engine Optimisation), but have never done it for dynamic database pages, or PHP pages. As some php file do not have a header and body part as html pages do, I would not know where to start, same with the content that comes out a database, as far as I know there is no way for Search engines to actually see what is in a database.

    Hi

    It is something I am just about to write into a PHP script I am finishing off (I think I will call it Content Magic). You can see a page generated by it at:

    www.chippingcampdenbaptistchurch.org.uk

    (this is only a test page, so don't be surprised if the links are not working, or go to broken pages).

    How I propose to go about it is this.

    First, any PHP generated should have head body etc, and it is not beyond the wit of man to make sure it does.

    In the head, put a meta tag to re-direct the robots, OR use the robots.txt file to re-direct them.

    Where to? A special html page that dumps the content of the database, roughly formatted (minus any email addresses to avoid spam).

    In that html page, have a java re-direct, so jo public doesn't get to see it. Coz it's java, you can make sure the robots doesn't understand it. If you are concerned a user with java disabled can still read it, put a java test in first usinga bit of php and redirect anyway. Or whatever.

    Trevor

      Trevor

      Thanks for the reply, I will give this a try ... sounds easy enough ... I think.

        I think you misunderstand how PHP works... PHP is SERVER-SIDE, it GENERATES HTML, the search engine will NEVER SEE YOUR PHP CODE.

        Thus, you optimize PHP pages the same way you optimize HTML pages for search engines, keywords, good content, keyword rich links, etc., etc.

        ClevaTreva's idea is bad for two reasons, one, it relies on client-side redirects and Java ( or Javascript I think he meant to say... ), and two, search engines loook down on and can permenantly ban you for what he's doing, commonly called Cloaking.

        What he's doing is not SEO at all, its trying to trick a search engine, cheating them of relevance, and its a good way to get your entire domain name banned.

          Hi Superwormy
          Thanks for the reply. True, a search engine spider will never see my code, and that is exactly the problem. We have a website whoose content is entirely stored in a MySQL database. There is thus no possibility that a search spider will see that, keywords, description and title of the page are relevant to that page, or the entire web site. Anything I put in the keywords or description cannot thus be checked against the actual content of the web site, which is the crux of the matter.
          I do not want to add a forward screen, it (a) would not suit the website and (b) is also not liked by the search engines.
          I am quite at a loss here ....

            No no no... you misunderstand again.

            The important thing to remember here is that search engines are ABSOLUTELY NO DIFFERENT FROM A REGULAR BROWSER, EXAMPLE: INTERNET EXPLORER / NETSCAPE / OPERA.

            Can people who browse to your website in Internet Explorer see the content that comes from MySQL? If yes, then SO CAN SEARCH ENGINES. And if no... they why the hell are you putting up content that no-one can see?

            The only thing that might SLOW SOME SEARCH ENGINES ( not all, mind you ) are links with big long query strings ( Example: http://www.phpbuilder.com/board/newreply.php?s=&action=newreply&threadid=10245972 will more than likely not be indexed )

              Ok, ok, I get it ...
              NO NEED TO SHOUT ...

              Thanks for the reply anyway.

                LOL no offense intended man, just making sure I got my point across :-)

                Glad I could help... didn't mean to get you all hot and bothered :-)

                  It's cool, no sweat ....

                  Nothing like a knock behind the noggin to get the thinking process started again .... especially on a realy bad Monday ...😃

                    .htaccess you can rewrite URL's so page-23-bla.html calls script.php?mode=page&id=23&something=bla

                    Spider friendly and worth getting to grip with

                      Write a Reply...