WooCommerce URL with a Hebrew word

2019-07-18 12:06发布

My setup is as follows:

  1. I've created a Wordpress site in Hebrew with the Wordpress Hebrew version.
  2. I added a theme from themeforest that do not have WooCommerce but support it. The theme supports RTL and I need it.
  3. The site is on a sub directory because it is still on testing, the old site is asp.net on a windows server that supports PHP and MySQL.

My problem is that my link to the product has a Hebrew word in it, like this: http://sitename.co.il/wp/index.php/מוצר/test-mil/. This URL causes a 404 error, but if I'm using this URL: http://sitename.co.il/wp/index.php/product/test-mil/ I can get to the page.

All the other links are working as they should.

What I've tried:

  1. I looked and found that changing the permalinks can help. I tried it, but it adds an extra "/" that causes a problem - when I change the permalink the URL look like this: http://sitename.co.il/wp/index.php//product/test-mil/ (Note the double //)
  2. I editing the PO file of WooCommerce, and change the slug from Hebrew to English, but this did not help.

Can this be a server problem?

If so, and if I move to a linux server, can I use 301 redirect form the asp.net pages to the new pages?

2条回答
疯言疯语
2楼-- · 2019-07-18 12:26

SOlved it !

You should change the default permalink in Wordpress Admin panel : Go to Setting in the dashboard choose permalink and scroll down to change the permalink for the product. Select the custom option (the last one) and write in English : product. That will do it !

查看更多
神经病院院长
3楼-- · 2019-07-18 12:31

It appears you're using IIS 7 on Windows. Having 404 issues with non-ASCII slugs is a known server issue for IIS 7.

On some instances, the issue can be fixed by adding the following code right after the WP_DEBUG constant definition in wp-config.php:

if (isset($_SERVER['UNENCODED_URL'])) {
    $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL'];
}

The other option you have is to move to an Apache server, where these URLs are supported properly. In this case you will be able to create the necessary 301 redirects quite easily.

查看更多
登录 后发表回答