different url in different browsers - asp.net-mvc

I'm using asp.net mvc. I made a link using Html.ActionLink chrome and Firefox shows me an seo friendly url like this:
http://localhost:3267/Store/Browse?category=آموزش-برنامه-نویسی
but IE 9.0 shows me something like this:
http://localhost:3267/Store/Browse?category=%D8%A7%D9%93%D9%85%D9%88%D8%B2%D8%B4-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87-%D9%86%D9%88%DB%8C%D8%B3%DB%8C
What should I do in order to show friendly seo url also in IE?

Those hexadecimal characters -- the ones that start with the % sign -- are the characters in the string, encoded for the URL. As far as a search engine is concerned, they are the same characters.

Related

Why are special characters replaced by � in my Google Search results?

My website encoding is ISO-8859-1.
ISO-8859-1 is defined as charset in the web pages and Google Search results have always looked good.
However, for several weeks now, special characters (é, à, è, â, etc.) are replaced by � in the Google Search results, for both page titles and page descriptions.
Screenshot of the Google Search rendering
The charset is defined on each page:
And the website looks good with all web browsers, there is no encoding errors.

Browser Support for UTF8 Encoded Characters in URL's

If I navigate to the following URL with a special UTF8 encoded character I get different results in web browsers:
http://example.com/lörickè
Firefox 37 - Shows the correct URL as above.
Chrome 42 - Shows the correct URL as above.
Edge - Shows the correct URL as above.
IE 11 - Shows percent encoded URL http://example.com/l%c3%b6rick%c3%a8/
Where can I find a list of browsers and versions that support this feature and are there any announcements of whether the new Microsoft Edge browser supports this.
This StackOverflow post highlights the above issue for those interested.
What is shown in browser address bars is not necessarily what is used internally.
If you enter http://example.com/lörickè in Firefox, it gets shown like that, but it actually gets percent-encoded and becomes http://example.com/l%C3%B6rick%C3%A8. This is for usability reasons (or, if IRIs are not supported, like in HTTP/1.1, for transforming an IRI into a URI), so users don’t necessarily have to enter the correct URL (with percent-encoding), and don’t get confused by seeing these cryptic parts.
You can easily check what really gets used by copy-pasting the URL from the address bar into a text document.
So the three browsers from your example probably use the same URI (i.e., percent-encoded), but two browsers decided to display the un-encoded variant instead.

Internet Explorer does not display Chinese characters from the URL

I am working on a requirement to display (make readable) characters from the URL.
When I use Google Chrome, it displays the parameters in Chinese - even though they are encoded to UTF-8.
When I use Mozilla Firefox, it displays the parameters in Chinese - even though they are encoded to UTF-8.
When I use Internet Explorer, it displays the parameters encoded in UTF-8.
N.B. The URL is encoded to UTF-8; I know that because when I copy the URL from the three of them and paste it to Notepad++ the three of them display the following:
/%E6%89%93%E5%BC%80%E7%9B%AE%E5%BD%95/%E7%9B%B8%E6%9C%BA/%E6%95%B0%E7%A0%81%E7%9B%B8%E6%9C%BA/%E5%B0%8F%E5%9E%8B%E6%95%B0%E7%A0%81%E7%9B%B8%E6%9C%BA/PowerShot-A480/p/1934793
Could it be that Mozilla Firefox and Google Chrome guys have this improvement that can make an encoded String readable and perhaps the IE guys do not support that? Or, is there any way to activate that with IE?
By the way... Going to View >> Encoding >> Unicode (UTF-8) takes care of the text inside of the page but does not make any difference for the text in the URL.
Any help will be greatly appreciated!
I've written a blog post about Internet Explorer not displaying the decoded version of non-ASCII characters and using IRIs to solve the problem.
As of today, we have the following situation:
HTML5 supports IRIs, i.e. URIs with Unicode character support
HTTP does not support IRIs, but all major browsers take care of converting IRIs to valid (encoded) URIs to retrieve the specified resource (page).
IE supports IRIs in the href attribute of anchor tags and properly displays them in its address bar just like when you enter your URL by hand (keyboard ;-)).
If you choose to percent-encode your IRI thus making it a URI, IE will not decode that URI back into an IRI.
So you could try the following:
Save your HTML files using UTF-8. This allows you to insert any Unicode character into it.
Do not percent-encode your URLs inside your HTML pages' links. Just use links like this: 亦思巴奚兵乱
A great article on the topic can also be found at the W3C: An Introduction to Multilingual Web Addresses.

Twitter share - redirects urlencode param %2C to %252C

I'm using the twitter custom share button 'Build your own tweet button' (https://dev.twitter.com/docs/tweet-button).
The documentation says that I have to use the query parameters to pass on params.
PROBLEM: Twitter is encoding the text param wrong when I pass it a URL encoded string. A comma (,) is displayed as %252C in the tweet message. Other chars are also wrong encoded.
I use PHP url encode (http://php.net/manual/en/function.urlencode.php) to prepare the string for the call.
$text = urlencode("I just backed ". $project->getTitle().", an amazing new mobile app, on appbackr, where anyone can back mobile apps");
Then I build the twitter link:
'http://www.twitter.com/share?url='.urlencode($projectUrl).'&via='.$via.'&text='.$text.'&related='.$user->getTwitterProfileName()
The final twitter url call is:
http://www.twitter.com/share?url=http%3A%2F%2Flocalhost%2Fapp%2Fbig-top-ballet&via=appbackr&text=I+just+backed+Big+Top+Ballet%2C+an+amazing+new+mobile+app%2C+on+appbackr%2C+where+anyone+can+back+mobile+apps&related=philippberner
As soon as the page opens in the browser (Chrome and Firefox) twitter redirects the URL to:
https://twitter.com/intent/tweet?related=philippberner&text=I+just+backed+Big+Top+Ballet%252C+an+amazing+new+mobile+app%252C+on+appbackr%252C+where+anyone+can+back+mobile+apps&url=http%253A%252F%252Flocalhost%252Fapp%252Fbig-top-ballet&via=appbackr
This displays the following message in the tweet box:
I just backed Big Top Ballet%2C an amazing new mobile app%2C on appbackr%2C where anyone can back mobile apps via #appbackr
It converts Top+Ballet%2C+an+amazing to Top+Ballet%252C+an+amazing. The comma is displayed properly when I manually change %252C to %2C in the twitter URL.
Actually, it has nothing much to do with url encoding.
It actually works with urlencode, with rawurlencode, or even without url encoding
Try the following URLs on opening a new tab.
With urlEncode: http://twitter.com/share?url=http%3A%2F%2Fwww.appbackr.com%2Fapp%2Fglass-ceiling&via=appbackr&text=I+just+backed+Glass+Ceiling%2C+an+amazing+new+mobile+app%2C+on+appbackr%2C+where+anyone+can+back+mobile+apps&related=
With rawurlEncode: http://twitter.com/share?url=http%3A%2F%2Fwww.appbackr.com%2Fapp%2Fglass-ceiling&via=appbackr&text=I%20just%20backed%20Glass%20Ceiling%2C%20an%20amazing%20new%20mobile%20app%2C%20on%20appbackr%2C%20where%20anyone%20can%20back%20mobile%20apps&related=
Without urlEncode: http://twitter.com/share?url=http%3A%2F%2Fwww.appbackr.com%2Fapp%2Fglass-ceiling&via=appbackr&text=I just backed Glass Ceiling, an amazing new mobile app, on appbackr, where anyone can back mobile apps&related=
The trick actually lies in using twitter.com instead of www.twitter.com. Not sure why there is a difference and it does not seem to be documented anywhere in twitter's documentation nor in google's search results. Although to be fair, Twitter's documentation did point to twitter.com and not www.twitter.com.
As always, it is definitely best practice to always urlencode the text even though it works without url encoding.
Use:
$text = rawurlencode("I just backed ". $project->getTitle().", an amazing new mobile app, on appbackr, where anyone can back mobile apps");
Then, use this URL:
'https://twitter.com/intent/tweet?url='.urlencode($projectUrl).'&via='.$via.'&text='.$text.'&related='.$user->getTwitterProfileName()

Unicode url of website and seo issue

I am working on a persina website. i want to change url structure of pages to be more seo friendly.but i don't know using unicode urls will have positive effect on SEO of website or not.
The pages unicode is UTF-8 . When i copy the link location in firefox and paste it in address bar something like this (for example) will appears:
http://mysite.com/pages/36161-%D8%B4%DB%8C%D9%85%D9%89.html
it is ok with search engines and seo ?
I encountered a similar problem on my site after a few tests and a long time I have concluded that Google deal well with these addresses and you have no reason to worry.
In my case the URLs was in Hebrew and there is not much difference between the two languages for Googlebot.
The major problems i has was with URLs in the site map they looked really bad, but google still indexed them.
Is this transition will be good for seo? I guess you it will but do not allow friendly URLs confuse you is only one criterion and there is no reason to trust him.
You get +1 on friendly URLs but there's no reason to forget about the rest of the onsite site Seo.
It is very important that you redirect the old URLs with 301 redirect to the new ones.
To not receive a 401 error that will cause you to be punished by the search engines

Resources