Perfect solution to the problem of wordpress 4.0 Chinese label 404

Perfect solution to the problem of wordpress 4.0 Chinese label 404

After the WordPress site has made pseudo static and defined the format of fixed connection, the problem of 404 Chinese tags will appear. Everything else is normal, that is, opening the WordPress Chinese tag tag is a 404 page error.

Since wp is a foreign product, it does not consider the compatibility of chinese labels. many friends will encounter the problem of chinese labels 404. let me share some solutions to this problem.

Resolve articles that WordPress cannot open Chinese tag links( The server Support UTF-8, no need to modify files to support Chinese links.)

 

First, find the "class wp. php" file in the wp includes directory of Wordpress, and make the following modifications.

Wp includes/class-wp.php 153 line:

$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_ SERVER['PATH_INFO'] : '';

Revised as:

$pathinfo  = isset( $_SERVER [ 'PATH_INFO' ] ) ? mb_convert_encoding( $_SERVER [ 'PATH_INFO' ], 'utf-8' , 'GBK' ) : '' ;

Wp includes/class-wp.php Line 157:

list( $req_uri ) = explode ( '?' , $_SERVER [ 'REQUEST_URI' ] );

Revised as:

list( $req_uri ) = explode ( '?' , mb_convert_encoding( $_SERVER [ 'REQUEST_URI' ], 'utf-8' , 'GBK' ) );

Original article reprint please specify: reprint from Seven Travelers Blog

Fixed link of this article: https://www.qxzxp.com/5518.html

Perfect solution to the 404 problem of wordpress 4.0 Chinese tags: there are currently 9 messages

  1. Come and have a look at your blog, hoping to update some articles every day. Welcome back: http://www.viplinger.cn

    2016-09-09 04:15 [Reply]
  2. The article is very good~! fabulous http://www.xevip.cn

    2016-08-28 07:34 [Reply]
  3. Not bad, praise one, ask for recognition and return visit

    2016-08-23 09:19 [Reply]
  4. I can't replace it. Now I click the Chinese tag to jump back to the home page and add an alias.

    2015-05-08 18:30 [Reply]
  5. Thanks for the tutorial, which solved the problem very well.

    2015-03-13 11:08 [Reply]
  6. 0F
    Uncle Ren :

    Just use a Linux host

    2015-01-14 13:15 [Reply]
  7. After looking for a round of tutorials, your method finally helped me solve the problem.

    2014-12-31 11:24 [Reply]
  8. Thank you, blogger. It's solved according to your method

    2014-11-20 15:12 [Reply]

Comment

7 + 8 =

Shortcut key: Ctrl+Enter