Jump to content

URL segments with special chars


suntrop
 Share

Recommended Posts

I am using images tags as links and some tags contain special characters (like schwarzweiß). Links are pointing to a URL segment.

Problem is, URL with special chars are not working. I added $config->pageNameCharset = 'UTF8'; in my config file but still I see a 404 on URL with special chars.

Any idea?

Link to comment
Share on other sites

In order to have UTF8 support in URLs you have to define a whitelist as well.

See here: https://processwire.com/blog/posts/page-name-charset-utf8/

With "social chars" you mean Umlaute? I guess... so you can have those either with the UTF8 page name support or you transform the classics like ä,ö,ü, and ß to ae, oe, ue, ans ss within the page name settings.

You will find it here: domain.tld/processwire/module/edit?name=InputfieldPageName

Link to comment
Share on other sites

Yes, I am speaking of Umlauts like äöü and ß. 

I did enable UTF8 page names and the whitelist contains all chars I need. However, it still shows a 404 for pages containing special chars.

Link to comment
Share on other sites

I can't remember I have used this before. Especially for URL segments. But the website uses a lot of image tags. Unfortunately tags are saved as simple strings not with slugs alongside.

Link to comment
Share on other sites

BTW: it doesn't work with page URL either. I can create/save a page with name like teßtpage but get a 404 here as well. So it doesn't seem to be URL segments problem only

I am using pW 3.0.165

Link to comment
Share on other sites

Mh, following the 4 steps from the blog works fine for me on 3.0.172 (in fact, i believe step 2 hasn’t been necessary for a while). Can you confirm that the config takes by putting var_dump($config->pageNameCharset, $config->pageNameWhitelist); into a template somewhere? Btw, just uncommenting 16B in .htaccess won’t do. You must also disable 16A.

Link to comment
Share on other sites

2 hours ago, Jan Romero said:

Can you confirm that the config takes

Yes, can confirm and I had disabled 16A

Just upgraded to current dev version. It got kind of worse. When I save a page with the pagename "teßtpage" the field is empty after admin page reloads. DB has a wrong punycode of "xn-stseite". However, saving "testsäite" will save but still results in a 404.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...