The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

How To Pass Google's Mobile Test

Sebastian Hanson

Active Member
affiliate
This is the non permanent resolve which will successfully pass Google's cellular check regardless of how big or small your site is. Utilize it unless you could enable an effective mobile solution.

1. Open the index.html or default.html page in your server's root directory.

2. Add the following code between the <head></head> tags. (Replace YOUR-WEBSITE.com with your domain name first!)

Code:
<link rel="alternate" media="only screen and (max-width: 640px)"  href="http://www.YOUR-WEBSITE.com/mobile/index.html">

3. After that add the JS code between the <head></head> tags.It will redirects mobile users to your mobile site.

Code:
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "/mobile/index.html";
}
//-->
</script>

4. Then save the file and then make a new folder on your server's root directory. rename it new folder to "mobile".

5. Open the link in your browser. (Replace YOUR-WEBSITE.com with your domain name)

Code:
http://www.google.com/gwt/x?noimg=1&wsc=pa&u=http://www.YOUR-WEBSITE.com

6. Just save the resulting page (a mobile representation of your site's home page) to your hard drive as "index.html" and then open it in a plain text editor/notepad.

7. Add the code between the <head></head> tags. (Again, replace YOUR-WEBSITE.com with your domain name first.)

Code:
<link rel="canonical" href="http://www.YOUR-WEBSITE.com/index.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

8. Search for and replace every instance of
Code:
<a href='/gwt/x?

with

Code:
<a href='http://www.google.com/gwt/x?

9. Save the index.html page that you just edited and upload it to the "mobile" directory.

10. Run your website through Google's mobile tester here:

Mobile-Friendly Test

Success!

If you find any problem let me know.
 
MI
Back