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

Best WordPress Permalink Settings_Which Pseudo-Static Rule is Better

Beginners inAfter building a website using WordPress, you will encounter the configuration ofWordPress Permalinks, 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

Best WordPress Permalink Settings Options

WordPress伪静态固定连接 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 onNaibabijiis 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 formatas shown in the image below:WordPress固定链接格式For example, select 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 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 report404 errorIf it cannot be opened, it is becausethe 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 correspondingPermalink pseudo-staticrules are as follows:

Baota Panel Pseudo-static Rule Configuration

Baota PanelFor Baota Panel, enter the Baota Panel backend, then in yourWebsiteSettingsselectPseudo-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 havealready added the websiteand realized youforgot to add the pseudo-static rule, there aretwo methods to solve it
  1. Use `lnmp vhost del` to delete the added virtual host configuration file, then use `lnmp vhost add` to re-add it.
  2. 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 awebsite 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.

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

「Naibabiji WordPress Website Building Coaching」 — From selecting a domain and purchasing hosting to installing themes and publishing posts, I「ll guide you through every step, helping you avoid detours and reach your goals directly.

👉 Learn about 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 to Follow