I have a question regarding Google crawling and AJAX.
This is how my url looks like:
example.com/#!contact
I know that Google and other search engines use ?_escaped_fragment_=
to replace the hash tag in order to get a certain page.
When I try:
example.com/?_escaped_fragment_=contact
it takes me to the index page and not contact.
I used this small piece of PHP where I usually load the ajax data, and now 'Fetch as Google' gets the content.
<div id="content">
<?php
if(isset($_GET['_escaped_fragment_'])){
$newID = $_GET['_escaped_fragment_'];
include_once $newID.'.php';
}
?>
</div>
Is this ok to use? IF crawling (using _escaped_fragment_) include this page with php, otherwise its a client and get him the page via ajax?
Thanks