According to the convention, when deploying WordPress programs for the company's projects, Mr. Jiang habitually simply sets fixed links, and then realizes the access effect of pseudo static URL addresses. However, after setting, when you return to the foreground, you will be prompted that 404 cannot find the page. Check the server and see that. htaccess file is not automatically generated from the directory. It should be a different problem for different hosts. Sometimes, pseudo static files will be automatically generated.
By the way, record this article, and record the pseudo static rules and setting methods of different system Web environments in the process of building WordPress, so that we can directly copy them for use next time. Generally speaking, we use Apache/Nginx/IIS environment more than the third one, because Lao Jiang always suggests that WP programs run stably in Linux systems.
First, Apache pseudo static rules and settings
# BEGIN WordPress
<IfModule mod_ rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !- f
RewriteCond %{REQUEST_FILENAME} !- d
RewriteRule . / index.php [L] </IfModule>
# END WordPress

We drop the code into the sublime and save it as a. htaccess file. Then FTP can be uploaded to the root directory of the website. It takes effect directly without restarting the environment.
Second, Nginx pseudo static rules and settings
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}

If we use a Linux VPS host, such as a regular one button package and a WEB panel, it may have its own WordPress Nginx pseudo static file, which we can directly reference when adding a site. If this is the case, and the environment is compiled and installed by ourselves without Nginx pseudo static rules, we can edit it ourselves and add it to the. conf file (server part) of the current site, or create a separate WP rule (wordpress. conf), and then call it in the configuration file.
Third, IIS pseudo static rules and settings
Old Jiang also saw many netizens build WP sites in Windows system, which may be because these friends are accustomed to and like visual remote desktop. If it is also useful and lacks pseudo static rules, use the following rule script.
<? xml version="1.0" encoding="UTF-8"?>< configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="category">
<match url="category/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="/index.php?category_name={R:1}" appendQueryString="false" logRewrittenUrl="false" />
</rule>
<rule name="tags">
<match url="tag/?(.*)" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
<action type="Rewrite" url="index.php?tag={R:1}" />
</rule>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule></rules>
</rewrite>
</system.webServer>
</configuration>

Save it as web.config, and then drop it to the root directory of the website. You need to check whether the IIS URL Rewrite module is installed on the server. If not, you need to install it.
To sum up, if we don't need to install and use WordPress programs, we recommend that you use Nginx or Apache in Linux systems. WordPress is also compatible and easy to set up.
Source: Lao Jiang Tribe » Common WordPress pseudo static rules - Apache/Nginx/IIS system environment |Welcome to share (public account: Old Jiang Play Operation)