If you are on a Linux host and the host supports mod_rewrite, then you don’t need to expend so much effort. However, some WordPress is installed on a Windows host. By default, WordPress will add index.php to the URL, which does not look good. As is pleasing to the eye, we can remove index.php and make WordPress run the same as if it were running on Linux.
First create a new wp-404.php file with a random name, add the following code, and then FTP to the server root directory.
<?php
$qs = $_SERVER['QUERY_STRING'];
$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['REQUEST_URI'] = substr($qs, $pos);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include('index.php');
?>
Point the 404 page to wp-404.php through the virtual host management software.
Finally, go to the WordPress backend, set up Permalink, OK, refresh the homepage, and find that URL rewrite is working normally.
Tried it under Windows 2003 + IIS6.0 and it was successful. I think some Linux hosts, but do not support .htaccess, can also use this method to rewrite URLs.
There is a problem, that is, Chinese is not supported. It is best for the postname and tag to be in English. For Chinese tags, you can set the tag slug.