Home > Back-end >  Wordpress/Redirection plugin - how to redirect migrated blogger=>Wordpress.com `?m=1` links?
Wordpress/Redirection plugin - how to redirect migrated blogger=>Wordpress.com `?m=1` links?

Time:12-13

I've migrated (Google) Blogger blog into Wordpress.com. The blog is rather large (300 posts) and I still get 404s multiple times a day due to URLs ending with ?m=1 query param.

e.g. https://softwarearchiblog.com/2019/01/technical-debt.html?m=1

will yield HTTP 404, while

https://softwarearchiblog.com/2019/01/technical-debt.html

works fine

I use the enter image description here

  • Is there any way around it?

  • Is there any other plugin that will "do this work" and can live side-by-side with Redirections?

  • Since I work with hosted Wordpress.com - I understand I cannot modify the .htaccess file for a more generic redirect. Any other way to do it?

CodePudding user response:

With the Redirection Plugin you can ignore the query parameters:

https://redirection.me/support/matching-a-url/

But I think you'll need an entry for each of your posts.

CodePudding user response:

I think, it's possible to do using javascript. You might put this code in the header.php or 404.php file (it depends on your theme) or use this plugin to insert the code Insert Headers and Footers

<script type="text/javascript">
        var uri = window.location.toString();
        if (uri.indexOf("&m=1", "&m=1") > 0) {
            var clean_uri = uri.substring(0, uri.indexOf("&m=1"));              
            window.location.replace(clean_uri);
        }
        var uri = window.location.toString();
        if (uri.indexOf("?m=1", "?m=1") > 0) {
            var clean_uri = uri.substring(0, uri.indexOf("?m=1"));
            window.location.replace(clean_uri);
        }; 
</script>
  • Related