When someone links to your website, but makes a typo while doing it, those broken inbound links will show up in Google Webmaster Tools in the Crawl Errors section as “Not Found”. Often they are easy to salvage by just adding a 301 redirect in the htaccess file.
But sometimes the typo is really weird - and that’s what I need your help with.
If it is something easy, like they just lost the last part of the URL, ( such as www.mydomain.com/pagenam ) then I fix it in htaccess this way:
RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteRule ^pagenam$ “http\:\/\/www\.mydomain\.com\/pagename\.html” [R=301,L]
But what about when the last part of the URL is really screwed up? Especially with non-text characters, like these:
www.mydomain.com/pagename.htmlsale
www.mydomain.com/pagename.htmlhttp://
www.mydomain.com/pagename.html"
www.mydomain.com/pagename.html/
How is the htaccess Rewrite Rule typed to deal with these oddballs?
Your help is greatly appreciated. Thanks!
Greg