homepage Welcome to WebmasterWorld Guest from 54.211.138.180
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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




msg:4612874
 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

 

lucy24




msg:4612918
 1:17 pm on Sep 26, 2013 (gmt 0)

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.

g1smd




msg:4612926
 1:34 pm on Sep 26, 2013 (gmt 0)

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

penders




msg:4612984
 6:38 pm on Sep 26, 2013 (gmt 0)

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.

lucy24




msg:4613015
 10:35 pm on Sep 26, 2013 (gmt 0)

/?

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.

g1smd




msg:4613029
 11:38 pm on Sep 26, 2013 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved