Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Link indexing

  1. #1
    New Coder
    Join Date
    Apr 2008
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Link indexing

    A mate of mine told me to build my site in this way, rather than html. I think he said it saves on the whole page reloading.

    Anyway, basically i have this script which pulls in the content from the pages.

    <?php if ($_GET['page'] == '') { include 'pages/main.php'; } elseif (!file_exists("pages/" . $_GET['page'] . ".php")) { include 'pages/404.php'; } else { include "pages/" . $_GET['page'] . ".php"; }
    ?>

    And then I have this code in the links.

    <a href="?page=project">project</a>

    Now, I have 2 points/queries.

    when the links are in the address bar they show up as www.meh.com/?page=project (not a good look) and secondly, he said that the code in the links will not be indexed by google either.

    So I am a bit screwed when it comes to all that content when google can't even get past the index page.

    I really dont know a lot about PHP.

    Can someone give me some help or advice?

    Thanks

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,465
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    You'll be looking into using .htaccess to change
    that "bad looking" code into something nicer.

    Look for tutorials on Rewrite Rules for .htaccess.

    ==========

    The deal about Google.

    Here's a site that has an index page (index.php) and all of
    the other pages are PHP codes that use "includes" ... there
    are no static pages:
    http://www.google.com/search?q=palo+...gn&btnG=Search

    Clicking on "more results from this site" brings up a bunch of them:
    http://www.google.com/search?hl=en&q...o+santo+design

    So Google does index PHP scripted (coded) pages and I think that
    "index.php" is really the only important file to have. All the rest of
    the pages are arbitrary, and the content changes on those anyhow.

    =============

    So you could choose to "clean-up" the URL in the address box
    by using .htaccess, but in essence, who realy cares? And come to
    think of it, look at all the URL's in the address box for this site?
    PHP dynamic pages are pretty much the "norm" on the internet now.

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts
    Google should index the page if a link is given to it, does't matter if the URL looks wierd. As for the fact that ?page=project is not userfriendly, with .htaccess and APACHE's mod_rewrite you can rewrite the urls into nice flat links. A nice tutorial for this is here, or perhaps here, and there are plenty of tutorials on google.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •