Beginners in
After building a website using WordPress, you will encounter the configuration of
WordPress Permalinks, also known as
WordPress Pseudo-static Settings. WordPress Permalinks are divided into Plain, Day and Name, Month and Name, Numeric, Post Name, and Custom Structure. So,
which permalink method is the best WordPress permalink setting?
The answer is as follows:
Best WordPress Permalink Settings Options
The best WordPress permalink options are Numeric and Post Name. If you are detail-oriented and willing to modify the post name for each article, then Post Name is recommended. Otherwise, simply choose Numeric.The permalink format you currently see on
Naibabijiis set to Numeric. For example, the link for this article „
WordPress Best Permalink Settings Suggestions_Which Permalink to Choose" is:
https://blog.naibabiji.com/tutorial/wordpress-gu-ding-lian-jie.html
Note: Choosing the Post Name format is beneficial for SEO, but it requires you to set a post name for each article. It's best to modify this name to English or Pinyin. If not modified, the URL will become your website address + the Chinese title, which is long and unsightly, like this:

Additionally, if you prefer a more personalized permalink style,
you can also choose a custom format。as shown in the image below:

For example, select Custom Structure and add .html at the end (if you need to
install the open-source version of the WordPress Mini Program, then you need to add .html to enable link redirection within the mini-program article) then the URL of this article will become
https://blog.naibabiji.com/2626.html
Of course, you can freely combine them. The available tags are as follows, with their corresponding meanings: %year% Year %monthnum% Month %day% Day %hour% Hour %minute% Minute %second% Second %post_id% Post ID (automatically generated) %postname% Post name (needs to be modified manually, otherwise the article title is used) %category% Category %author% Author The .html at the end can be anything you like, for example, .love or anything else you can think of.
404 Error After Setting WordPress Permalinks
After you set up the WordPress Permalink settings, accessing the website homepage works fine, but accessing article pages may report
404 errorIf it cannot be opened, it is because
the pseudo-static rules on your server are not properly configured.。
Pseudo-static Rule Configuration
Currently, common environments online are Baota Panel or LNMP one-click installation packages. The corresponding
Permalink pseudo-staticrules are as follows:
Baota Panel Pseudo-static Rule Configuration
Baota PanelFor Baota Panel, enter the Baota Panel backend, then in your
Website的
Settingsselect
Pseudo-static, then choose WordPress and save.

LNMP One-click Installation Package Pseudo-static Configuration Rules
For the LNMP one-click package, you can set the pseudo-static rules when adding a virtual host. Specifically, when adding a virtual host, you will be asked whether to use pseudo-static. Enter y, then enter wordpress.

Whether to enable pseudo-static, enter y and press Enter.

Enter the pseudo-static rule here. For installing WordPress, simply enter wordpress. If WordPress is installed in a subdirectory, enter wp2. If you have
already added the websiteand realized you
forgot to add the pseudo-static rule, there are
two methods to solve it:
- Use `lnmp vhost del` to delete the added virtual host configuration file, then use `lnmp vhost add` to re-add it.
- Configure the virtual host's .conf file and add the pseudo-static rule: `include rewrite/wordpress.conf;`
Pseudo-static Configuration for Self-compiled nginx
If you are not using a one-click package or Baota Panel for your website environment, but have compiled nginx yourself, then add the following content to your virtual host configuration information and restart nginx.
location /
{
try_files $uri $uri/ /index.php?$args;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;Pseudo-static Rules for nginx Subdirectory
Change 'blog' below to your subdirectory name and add it to the virtual host configuration file.
location /blog/ {
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 (.*) /blog/index.php;
}
}
rewrite /blog/wp-admin$ $scheme://$host$uri/ permanent;Apache WordPress Pseudo-static Rules
Insert the following code into the .htaccess file in the website root directory to enable WordPress pseudo-static rules under Apache.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Notes
It is particularly important to note that, from a
website SEOlong-term perspective, decide on which Permalink setting to use from the start. Once the website is officially launched and operational, do not easily change the Permalink format, as it may cause issues like loss of website ranking and other SEO disadvantages.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.