Solution problem? M = 1 of mobile redirect when migrating to WordPress

We are already in WordPress! After a long time of inactivity in the blog I have decided to resume it by changing CMS for better administration and usability for readers 😉 previously and for about 8 years I used Blogger, a platform that I have a lot of affection for, but I must say that this little bird finished fledging and it was time to «leave the nest to take flight », Metaphorically speaking clearly.

Precisely during the Blogger to WordPress migrationOne of the problems that many bloggers can give headaches, cause them to lose Google traffic and fill the Webmaster tools panel with 404 errors, is mobile redirection, remember that in Blogger the URL when you visit from a cell phone ends in ? m = 1, for example: http://miblogbonito.com/2015/11/nombre-super-entrada.html?m = 1

When changing the platform, that ending in the URL is still maintained, so a 301 redirect must be made, that is, take the visitor from that old mobile URL to the new one; sin? m = 1.

Mobile redirect problem in Blogger

And to achieve this, there are 2 ways, one of them through the plugin Blogger 301 Redirect, but since I do not like to install plugins when you can enter code directly, we will then see how to do it manually and in a simple way for any user.

Modifying the .htaccess file

Step 1:.- Log in to the cPanel of your hosting and open the File Manager, choosing the option 'Root directory for' and activating the box 'Show hidden files' (dotfiles).

CPanel file manager

Step 2:.- In the new tab that will open from the public_html folder, look for the file .htaccess and with a right click on it and the option 'Code edit' or from the same panel with «Code editor» we proceed with the next step, which is the most important. (If you want to make a backup of that file first).

Edit .htaccess WordPress

Step 3:.- When opening with the code editor you will see that the .htaccess file contains the following:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^ index \ .php $ - [L]
RewriteCond% {REQUEST_FILENAME}!-F
RewriteCond% {REQUEST_FILENAME}!-D
RewriteRule. /index.php [L]

# END WordPress

After RewriteBase / paste the following:

RewriteEngine On
RewriteCond% {QUERY_STRING} ^ m = 1 $
RewriteRule ^ (. *) $ / $ 1? [R = 301, L]

Finally leaving the .htaccess file as follows:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteEngine On
RewriteCond% {QUERY_STRING} ^ m = 1 $
RewriteRule ^ (. *) $ / $ 1? [R = 301, L]
RewriteRule ^ index \ .php $ - [L]
RewriteCond% {REQUEST_FILENAME}!-F
RewriteCond% {REQUEST_FILENAME}!-D
RewriteRule. /index.php [L]

# END WordPress

What is in red is the change we have made, which is the 301 redirect of the mobile version? M = 1 of blogger, to the new URL after the migration to WordPress.

Finally save the changes in the .htaccess file and immediately do the test by visiting from google any result of your site that is indexed and the 404 error problem with the mobile version will have been solved 🙂

Another easier way: with Yoast SEO

If you have installed this fantastic plugin to improve the SEO of your blog, you should know that in the "Tools" section, there is a "File Editor", which precisely gives you quick access to edit the .htaccess file in a a jiffy, without entering your cPanel or with FTP clients.

Yoast SEO tools

There you just add the codes as mentioned above, save the changes to the .htaccess and problem fixed instantly.

I hope this solution has helped you (if you had this problem), or if you have a blog on Blogger and you plan to migrate to WordPress with your own hosting one day. If not, I would be happy if you share the post anyway, because someone might be interested 😀


10 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Actualidad Blog
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Manuel said

    interesting trick, thanks.

    1.    Marcelo camacho said

      To you Manuel, thanks to one of your comments I was encouraged to return to WordPress 😀

  2.   Manuel said

    ahhh, well we hope wordpress is very useful for you then 🙂

  3.   spend said

    Great contribution, by the way, how do you redirect blogger to wordpress?
    thanks and regards.

    1.    Marcelo camacho said

      Thanks spend! For the redirection I use the plugin «Blogger To WordPress Redirection», who is in charge of doing the magic 😉

  4.   Florence said

    It helped me! Thank you!

    1.    Marcelo camacho said

      How good Florence! Thanks to you for the comment 🙂

  5.   Enrique Villanueva said

    Hello Marcelo, I have a website for almost half a year with a blogger and I am doing well and well I wanted to ask you if that redirection that blogger does when you enter from a cell phone «? M = 1» affects my positioning in blogger or how can I change o that does not appear, greetings.
    Thanks in Advance 🙂

    1.    Marcelo camacho said

      Hi Enrique, the parameter "? M = 1" as far as I know cannot be avoided for the mobile redirect in Blogger. However, in my experience, it does not affect the indexing in the SERPS or the SEO of your blog 😀
      Greetings.

  6.   Pili said

    Fantastic! I just did a migration from blogger to wordpress and the urls positioned with M1 gave an error. Now it works great!

    Thank you!