Search code examples
.htaccessjoomlajoomla2.5http-redirectjoomla-sef-urls

301 redirect and unicode output


I'm doing various 301 directs after a major website brush-up, however some 404 pages seems to appear again and again.

The pattern is pretty straight forward, as there seems to be a problem with unicode characters.

However it seems like i have been making some many 301 redirects on these troublesome links that the unicode character is now just a part of the redirected link.

So if i have a SEF url that looks like this that gives me a 404:

http://mysite.com/mobileconnection-%7C-yourchoice.html

In theory the correct url would be:

http://mysite.com/mobileconnection-|-yourchoice.html

It seems like I'm unable to rewrite this back to correct looking character.

Could anyone point me in some kind of direction? :)

UPDATE

The problem started in google webmaster tools.. Aparently google displays 404 URL´s in Unicode format, so the | (pipe) was displayed as %7C. I made redirects using webmaster tools and ended up with SEF urls that conatined %7C instad of the pipe.

The answer was good, i will rate it as usefull for now :)


Solution

  • That is a bit of a problem. Because not all browsers will pass | character as it is, many old will URL-encode it. So using not ASCII symbols in URLs is not a good solution at all.

    Also it is hard to deal with this URL in the matter that web-servers will pass encoded character, so in rewrite rule you always need to use %7C instead of |.

    Please use ASCII in URL ;)

    You could apart of using redirect also use URL rewrite in your .htaccess replacing %7C with |, but i am not sure web-server will be able to handle this replace.