Welcome to WebmasterWorld Guest from 54.145.246.183

Forum Moderators: Ocean10000 & incrediBILL & phranque

Redirect %E2%80%8E and other url error endings to right place

   
10:30 am on Sep 26, 2013 (gmt 0)



Iv got quite a few good links that are out of my control but link to things like:
http://mywebsite.com/somepage/%E2%80%8E
when i want it to go to just
http://mywebsite.com/somepage


often the %E2%80%8E is created if when some one is linking forgets to remove the /

other endings i get are....

/‎&
/‎
& -----added to the end of the link... ie ..root/somepage&


any htaccess rules ? with which add to htaccess to redirect things like this to the right place?

Any wordpress plugins that will help?

also:I also dont in any of my urls have the character &

thanks

(After reading about how google goes as far as to discount links pointing to 404 pages just like with disavow... i really would need a fix for this) thanks
1:17 pm on Sep 26, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I also dont in any of my urls have the character &

I should hope not, since & is a reserved character. It's used to connect pieces of a query string, and shouldn't show up anywhere else.

often the %E2%80%8E is created if when some one is linking forgets to remove the /

Don't quite see how. I raced to look it up as soon as I saw the subject line; for variety's sake it isn't the BOM but the "left-to-right marker". (What's it even doing there? Where do your visitors come from?) In other words, ‎ ... and also ‎

Is there a finite number of specific characters you need to get rid of? Are they ALL variants of the left-to-right marker? The only one that's missing from your list is 200E ;)

What's your past experience with redirecting? You'll need to make one or more RewriteRules. But you have to work with whatever is already in your htaccess. Do you use a CMS? If so, there are rules already in place and you have to be careful to work around them.

After reading about how google goes as far as to discount links pointing to 404 pages

But that would count against the people on the outside, not you. It's not your fault your fans can't type.
1:34 pm on Sep 26, 2013 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Near the start of your redirects:
RewriteRule ^([^%&]+)/?[%&] http://www.example.com/$1 [R=301,L]

and long before your non-www/www canonicalisation redirect.
6:38 pm on Sep 26, 2013 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



http://mywebsite.com/somepage/%E2%80%8E


Does this result in a 404? From your last sentence I guess that it might do, but what I was going to suggest (if it's not a 404) is to simply include a rel="canonical" link element on the page with the correct/canonical URL.


But that would count against the people on the outside, not you. It's not your fault your fans can't type.


But if the link is returning a 404, he's not going to benefit from the inbound links in terms of SEO.
10:35 pm on Sep 26, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



/?

Is that a ghost from a different thread? :) Here I don't see how the / could ever be excluded from the capture, since it fits into [^&%] and is explicitly called optional. You'd have to say
^([^%&]+[^%&/])/?[%&]
to force exclusion. Or, in htaccess,
^(([^%&]+[^%&/])/?)?[%&]
to allow for root requests.

Note for people coming along to read this thread later:
The & has no effect on any ampersands that might legitimately occur in your query string, and the % similarly don't apply to encoded parts of the query. We're looking strictly at the "path" or non-query part of the URL.
11:38 pm on Sep 26, 2013 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Yeah, the REgEx pattern needs a massive improvement.
I ran into several snags while trying to improve it and had other stuff to do.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month