I have two html files, one for mobile and the other file for the other devices. I am detecting mobile devices by using PHP a if ($modile) and this is followed by an include("example.html"> to determine which index is to be viewed.

Here's an example of my code:

    if($modile) include("index_m.html");
    else include("index.html");

Each indexes are slightly different than one and another, and look like this in the address bar:

  • http://www.example.com/index.html
  • http://www.example.com/index_m.html


Since my site is using two index files, will search engines consider this bad SEO?

  • 1
    Not sure why you tagged the question with responsive design, since using two indexes, is not responsive design. Responsive design is one site for all devices without serving different files. In terms of SEO, one site is always best unless you have a web application that requires its own environment. May 5 '16 at 22:07

While exposed index files isn't a URL-friendly approach, your idea of redirecting to a specific index file based on what the client's device is actually a fabulous start because then search engines (especially google) can understand that you have a desktop and mobile version of your page and google will try to display the most relevant page to the client based on his/her device.

As an added bonus, your idea will score well when you run it through Google's page-speed insights since it likes to check your page for mobile device compatibility as well. I believe google webmaster tools (search console) has a section where it would complain if your page is not mobile friendly.

Google has an article on how you can add code to make your separate URLs more helpful to google when it comes time for it to index them.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.