Question about google searching

Hi dears,

My question is:

I have to my page the main file called index.php which isnt written (obviously) in the Url (

well.. now i'm developing mobile and i want to separate the file in 3 parts:
index.php (script only)
index-mobile.php (new page)
index-desktop.php (copy of the content of index.php before mobile version)

when the user access my page, firstly I check their user agent in this new index.php to define if they come from mobile or desktop.

after this, in my index.php i just do
<?php include 'index-mobile.php'; ?> if mobile
<?php include 'index-desktop.php';?> if desktop

my question is (for desktop only), is google able to read this  index-desktop.php include to my main index.php ?

if yes, does google re-index these index-desktop.php for my desktop version ?

also, would this change affects my current indexed pages for desktop ?

if yes, if i set my server to read first default.php and this default.php be used as script to define where the user comes from and then I include index.php for desktop and index-mobile.php for mobile, would this help ?

Thank You
Judson GuimarãesAsked:
Who is Participating?
Ray PaseurCommented:
If you're new to web application development with PHP, it can be a lot to learn.  This article might help you get started in the right direction.
Lucas BishopClick TrackerCommented:
Intentionally creating duplicate content is the equivalent of planting an SEO mine field.

I'd recommend you look into responsive design. You can use a single page and adjust the layout for different screen widths. This is the current best practice being used today.
Judson GuimarãesAuthor Commented:
actually my page is e-commerce and not institutional page... and since i'm from brazil, mobile conections sux for responsive design.. i'm using dinamic content.. which for mobile loads an file with less contents and desktop full content.

my main question is about if google is able to read my index.php file and discover that i'm actually including index-desktop.php
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Dave BaldwinFixer of ProblemsCommented:
No, a PHP 'include' statement is not visible from outside, it just looks like part of the page.  But if they use a 'mobile' bot then they will be able to see that the content is different from the 'regular' view.
Judson GuimarãesAuthor Commented:
not even Google could be able to read my php include ??

so.. if google read my page before index.php and the new index.php with include 'index-desktop.php', he will think its the same page ??
Lucas BishopClick TrackerCommented:
The php include is handled on the server side, before the page is rendered for Google. When you view-source on your page, you will see what googlebot sees.

However, there is a possibility that Google finds your index-desktop.php by spidering your site and lists it in their index separately from index.php.
Judson GuimarãesAuthor Commented:
actually i'm 10 years php programmer.. and actually I already knew the answer... the problem is that our SEO guy swear a god that google could read my include 'index-desktop.php' in index.php file, and then it had affected the current indexed pages which the number decreased (coincidentally the date I did this change)

I'll share points for you all.
thank you
Dave BaldwinFixer of ProblemsCommented:
To me, SEO is advertising and those people will say anything that pops into their tiny little heads.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.