Topic on Project:Support desk

Spiros71 (talkcontribs)

I use PAGENAME in a template as part of a URL. However, when the pagename is more than a word (has space) the URL breaks. Is there a way to use it in a URL safe way?

Notmadewelcome (talkcontribs)

Use Uul0qlni8jnp5kpo, a variant that encodes spaces to make a valid URL

Spiros71 (talkcontribs)

Thank you, I found it here Manual:PAGENAMEE encoding#PAGENAMEE as it was parsed on this page. However, there is one issue, for a phrase (words separated with spaces), the wiki automatically adds an underscore in the URL, so in the search it is encoded with an underscore rather than a space.

Ciencia Al Poder (talkcontribs)
Spiros71 (talkcontribs)
Notmadewelcome (talkcontribs)

When I wanted to couple a wiki with my own website, I used .htaccess RewriteRule to allow incoming underscores to be treated as space, so I could offer both. This was easier than getting mediawiki to change its approach

Spiros71 (talkcontribs)

Well, in my case it is outgoing URLs to third sites.