🚀 Is building a website too difficult? Let me guide you step by step—Learn about the 「Naibabiji WordPress Website Building Coaching Service」 →

WordPress Best Permalink Settings_Which Pseudo-Static Rule is Better

Beginners, afterbuilding a website using WordPress, will encounter theWordPress permalink, also known asWordPress 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:

WordPress Best Permalink Settings Options

WordPress伪静态固定连接 The best WordPress permalink can be either Numeric or Post Name.If you are detail-oriented and willing to modify the post name for each article, then Post Name is recommended. Otherwise, just choose Numeric.The permalink format you currently see onNaibabijichooses the Numeric type. For example, the link for this article „WordPress Best Permalink Setting Suggestions_Which Permalink to Set" 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 method,you can also choose a custom formatlike the image below:WordPress固定链接格式For example, choose a custom structure and add .html at the end (if you need toinstall the open-source version of the WordPress mini-program, then you need to add .html to enable link redirection within the mini-program articles). Then the URL for this article would become
https://blog.naibabiji.com/2626.html
Of course, you can freely combine them. The available tags and their meanings are as follows: %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 by yourself; if not modified, the article title is used) %category% Category %author% Author. The .html at the end can be anything you like, such as .love or anything else you can think of.

WordPress Permalink 404 Error

After you finish setting the WordPress permalink settings, if the homepage loads fine but article pages show a404 errorand won't open, it's becausethe pseudo-static rules on your server are not properly configured.

Pseudo-Static Rule Settings

Currently, the common environments found online are Baota Panel or LNMP one-click packages, corresponding toPermalink pseudo-staticrules are as follows:

Baota Panel Pseudo-Static Rule Settings

Baota PanelIf using Baota Panel, go to the backend of Baota Panel, then in yourWebsiteSettingsselectPseudo-staticand choose WordPress to save.宝塔面板伪静态规则

LNMP One-Click Package Pseudo-Static Settings Rules

For LNMP one-click packages, pseudo-static rules can be set when adding a virtual host. Specifically, during the virtual host addition process, when asked whether to use pseudo-static, enter y, then input WordPress.是否启用伪静态Whether to enable pseudo-static, enter y and press Enter.输入伪静态规则Here, input the pseudo-static rule; for installing WordPress, simply enter WordPress. If WordPress is installed in a subdirectory, enter wp2. If you arehave already added the websiteand realizeforgot to add pseudo-static rulesthere aretwo methods to resolve
  1. lnmp vhost del to delete the added virtual host configuration file, then lnmp vhost add to re-add.
  2. Configure the virtual host's conf file by adding the pseudo-static rule: include rewrite/wordpress.conf;

Self-compiled nginx configuration for pseudo-static

If you are not using a one-click package or Baota Panel for the website environment, but have compiled nginx yourself, then manually add the following content to the virtual host configuration information and restart nginx.
location /
{
	 try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

nginx subdirectory pseudo-static rules

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.
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>

Notes

It is particularly important to note that fromwebsite SEOa long-term perspective, determine which permalink setting to use from the start. Once the website is officially launched and operational, do not easily change the form of permalinks, as it may lead to SEO disadvantages such as loss of website rankings.

🚀 Still feeling confused after reading the tutorial? Let me guide you step-by-step.

「Naibabiji WordPress Website Building Coaching Service」—From choosing a domain and buying hosting, to installing a Theme and publishing content, I「ll coach you through every step, helping you avoid detours and reach your goal directly.

👉 Learn about the Website Building Coaching Service
🔒

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.

×
二维码

Scan QR Code to Follow

AI Website Building Assistant

🤖
Hello! I am the Naibabiji AI Assistant. How can I help you?
Quick Consultation: