带有希伯来语单词的 WooCommerce URL [英] WooCommerce URL with a Hebrew word

查看:31
本文介绍了带有希伯来语单词的 WooCommerce URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的设置如下:

  1. 我使用 Wordpress 希伯来语版本创建了一个希伯来语 Wordpress 网站.
  2. 我从 themeforest 添加了一个没有 WooCommerce 但支持它的主题.主题支持 RTL,我需要它.
  3. 该站点位于子目录中,因为它仍在测试中,旧站点是支持 PHP 和 MySQL 的 Windows 服务器上的 asp.net.

我的问题是我的产品链接中有一个希伯来语词,如下所示:http://sitename.co.il/wp/index.php/מוצר/test-mil/.此 URL 会导致 404 错误,但如果我使用此 URL:http://sitename.co.il/wp/index.php/product/test-mil/我可以进入页面.

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.

我尝试过的:

  1. 我查看并发现更改永久链接会有所帮助.我试过了,但它添加了一个额外的 "/" 导致问题 - 当我更改永久链接时,URL 如下所示:http://sitename.co.il/wp/index.php//product/test-mil/(注意双//)
  2. 我编辑了 WooCommerce 的 PO 文件,并将 slug 从希伯来语更改为英语,但这没有帮助.
  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?

如果是这样,如果我移动到 linux 服务器,我可以使用 301 重定向从 asp.net 页面到新页面吗?

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

推荐答案

您似乎在 Windows 上使用 IIS 7.非 ASCII slug 出现 404 问题是 IIS 7 的已知服务器问题.

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

在某些情况下,可以通过在 wp-config.php 中的 WP_DEBUG 常量定义之后添加以下代码来解决此问题:

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'];
}

您的另一个选择是迁移到 Apache 服务器,在那里这些 URL 得到正确支持.在这种情况下,您将能够非常轻松地创建必要的 301 重定向.

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.

这篇关于带有希伯来语单词的 WooCommerce URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆