0

I created a website www.example.com. I created a mobile version of the website with subdomain www.m.example.com. I used htaccess file for redirectiong to mobile version in smartphones. I put my mobile website's files in folder named "mobile". I put a robot.txt file in main root folder for prevent indexing mobile urls in search engines result. my robot.txt file is like this.

User-agent: *
Disallow: /mobile/

I also put a robot.txt file in folder named mobile.

User-agent: *
Disallow: /

My problem is that. In desktop version all result and snippets are correct. but when i searching in mobil, the result in snippet shows like this.

A description for this result is not available because of this site's robots.txt – learn more

How to solve this?

Nidhi
  • 153
  • 2
  • 12
  • `How to solve this?` You allow a page. You can't do a complete block of the site without getting that message. It can't read a description of your site because you've blocked all URLs. – Panama Jack Jun 10 '15 at 19:17
  • @PanamaJack but sir if I allow mobile urls satrting with m.example.com/... Then both url for desktop and mobile will indexed? – Nidhi Jun 11 '15 at 08:33
  • This is the biggest problem with having separate mobile and desktop versions of the same site with separate URLs. You have to choose between letting them both be indexed or blocking one of them. Neither choice is ideal. One common solution is to use responsive design to make the same page look good on all platforms. – plasticinsect Jun 11 '15 at 21:13

1 Answers1

1

By using this robots.txt on www.m.example.com

User-agent: *
Disallow: /

you are forbidding bots to crawl any resource on www.m.example.com.

If bots are not allowed to crawl, they can’t access your meta-description.

So everything is working as intended.

If you want your pages to get crawled (and indexed), you have to allow it in your robots.txt (or remove it altogether).

By using the canonical link type, you can denote that two (or more) pages are the same, or that they only have trivial differences (e.g., different HTML structure, table sorted differently etc.), or that one is the superset of the other.
By using the alternate link type, you can denote that it’s an alternate representation of essentially the same content.
(You can see examples in my answer on Webmasters SE.)

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360