I. Each software version

Ubuntu 16.04

Apache 2.4

WordPress 5.2-zh_CN

Second, the steps

2.1 Deleting the “. Htaccess “file

$ sudo rm -i /var/www/html/.htaccess
Copy the code

Then y, press Enter but failed to solve, on the Internet see many people are to modify the Apache configuration file to solve.

2.2 Modifying The Apache Configuration

Take Ubuntu 16.04 as an example

2.2.1 Enabling the Mod_rewrite module

Run it on the terminal

$ sudo a2enmod rewrite
Copy the code

This enables the Mod_rewrite module.

2.2.2 Modifying the Configuration File

 $ sudo vim /etc/apache2/apache2.conf
Copy the code

will

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Copy the code

Modified into

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Copy the code

I still FOUND NOT FOUND here, but I saw someone on the Internet said that you can install the method of modifying the article link to solve the problem

2.3 Installing the Plug-in: Pinyin Permalink

The plugin can automatically change the links of articles to pinyin, which is caused by the inclusion of Chinese characters in wordpress generated links. Enter your own WordPress, “sidebar “-” Plugins “- “Install plugins “-> search “Pinyin Permalink”-> Install -> enter your server username and password -> Enable.

Third, pay attention to

3.1 A hint about the title

Although it may appear that fixed links were changed to cause NOT FOUND, it could actually be apache’s Mod_rewrite module turned off or AllowOverride set to None (default: None), or wordpress generated links containing Chinese characters.

3.2 The Apache configuration file name and directory are different depending on the OPERATING system (OS) and software version

(On Windows, the apache configuration file is httpd.conf and Ubuntu is apache2.conf.)

4. Reference links

Ubuntu starts the Mod_rewrite module

Fixed the issue that some wordpress blog post pages cannot be displayed