2

I moved from Blogger to Wordpress. I set my prefered domain to non-www in webmaster tools. I submitted a sitemap. My website is OK when I browse it. Links from other sites to my pages are well formed. In webmaster tools every page URL has a 404 complement ending with .htmlprint

enter image description here

Is there any way to remove this "print" from my website? Must I redirect every link with .htmlprint to .html?

  • The 404 report in Google Search Console (formerly Webmaster Tools) should tell you from where that page is being linked from when you click on that URL in the report. – MrWhite Dec 27 '15 at 10:41
3

Somewhere your site is linking to the "htmlprint" version. The first thing to do is figure out where that broken link is and fix it. View the source of your page and search for "htmlprint".

Instead, it is possible that Googlebot is misinterpreting JavaScript code in your page. Googlebot tries to execute JavaScript to find URLs. You may have something like document.location + "print" somewhere in your JavaScript. If so, there is no urgent need to fix it, Googlebot is just being stupid.

The third possibility is that there is a third party site linking to these URLs. In that case, there is also nothing for you to fix.

Once you have identified the source of the URLs and fixed it if possible, you can redirect all the URLs. You can use the RedirectMatch directive in .htaccess to do so for all of them with one statement:

RedirectMatch "/(.*\.html)print$" "http://example.com/$1"

Redirecting to remove URL parameters is a little bit different. To remove a query string of m=1you can use these rewrite rules:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule (.*) $1? [R=permanent]
  • So if I find that, should i remove it and than put that redirect in .hatccess or just to do this redirection? and if I remove, should i remove just "print" or there is also additional code that goes with it to remove? Thank you for replay :) – Nasiha Erdic Dec 27 '15 at 10:30
  • 1
    Find the broken links and remove them. Then do the redirection. – Stephen Ostermiller Dec 27 '15 at 10:31
  • Thank you, it works, all now are redirected to .html, but now when I was marking as fixed in webmaster tools , more than 100 post I have now with additional ?m=1 I had htmlprint and now need to fix html?m=1 I tried just instead 'print' to put ?m=1 but doesn't work (I installed link checker plugin and there are just some normal broken link that I'm solving now, just broken videos, images, but there are no htmlprint neither html?m=1 urls to fix) any idea?? – Nasiha Erdic Dec 27 '15 at 16:28
  • I've put how to do that into the answer, it is a bit different. – Stephen Ostermiller Dec 27 '15 at 16:48
  • Oh I did not see it,, thanks mate a lot, it doesn't work, I added that code and turns to 4o4, I tried to add also ? since my posts ends with ..html?m=1 but doesnt' work... – Nasiha Erdic Dec 28 '15 at 15:25

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.