Special characters (+ symbole) in url
How can I overcome the problem of "+" character in my url? I'm trying to request the articles that contain "+" symboles like mathematical titled expressions: A+B=C, but it doesn't work on my site (it was working but I don't know what happened lately).
Instead the "+" is treated as a space " " which is then translated by the wiki as "_" and the result of A+B=C becomes A B=C.
I'm using short urls. Can you help me?
You should use {{urlencode:+}} whenever you must have a plus sign ("+") or other restricted character. (See Help:Magic words#URL data) That said if you can move the pages you should.
Thanks for reply. I'm not sure if this can resolve my problem but everything was perfect since the time I installed my website until few days ago when I realized that the pages containing this character were not able to be called any longer. I'm sure I created them and was calling them from time to time. Now I can create a page but can not call it. To make things clear,
- go to http://www.ejabah.info/wiki and try to append the expression "A+B" in the address box and then see what you get instead.
- If you try it without short url, http://www.ejabah.info/w/index.php?title=A+B, you would get the same issue.
- If you try with short url and encoding, http://www.ejabah.info/wiki/A%2BB, you get the same issue.
- If you try without short url but with encoding, http://www.ejabah.info/w/index.php?title=A%2BB, you get the problem solved.
But my site is with short URL and so all my links are called this way. So how can I solve it?
You can see that Mediawiki doesn't have this problem here.
I feel that something done at the hosting server (example changed the redirecting rules in the Apache). I called their help but they couldn't resolve it.
You should find someone familier with that language as I can't even identify it.
Thanks all for your support. I think I could resolve the problem now, just to share it in case anyone faces it again. There is an option, $wgUsePathInfo that can be set in LocalSettings.php. This problem arises when dealing with short URLs and to fix it, add the following line to your LocalSettings.php
$wgUsePathInfo = true; # Enable use of pretty URLs
Note $wgUsePathInfo should be auto-detected based on if your webserver supports it (or at least I thought it was. Maybe that has changed, maybe our auto-detection is just crappy). I'm kind of surprised that changing it has any affect in this situation.
I believe this issue can also sometimes be caused by using the wrong flags in a rewriteRule clause in a .htaccess file.
You may be right, Bawolff and I might mistakenly removed that someday because it was working fine before. But I can assure it fixed the problem that partially originated from rewriteRule of course.