It's quite common, although not always recommended, to see something in the form of http://my.site.com/index.php?page=welcome"
or simply http://my.site.com?page=welcome
. The script (index.php in this case) will then get a "page" item equal to "welcome".
If there are several of these in links within a page, will Google and other search engines index each as a separate page, or will it ignore the "query" part of the url? Consider this simplified example:
<?php // Our index.php - Simple multi-view page ?>
<a href="index.php?page=welcome">Welcome Page</a>
<a href="index.php?page=about">About Page</a>
<a href="index.php?page=contact">Contact Page</a>
<?php
if(!isset($_GET["page"])) $_GET["page"]="welcome";
switch( $_GET["page"] ) {
case "about": echo '<p>This is the About page</p>'; break
case "about": echo '<p>This is the Contact page</p>'; break
default: echo '<p>This is the Welcome page</p>'; break
}
?>
My question here is when Google crawls this page, will it see each of the three pages we link to as separate links, or will it only index a single page (index.php) and ignore everything after the ?
?
&
s into an array, (2) look at the first element of the array, (3) if it doesn't contain an = then it's used as a virtual page name. This has the advantage that there is no = so I can literally take a link that says "?about" and translate it to "/about" or vice versa. – SteJ Aug 20 '16 at 0:35