WordPress有自己的url路由系统。你可以自定义它来缩短你的长url。如果你无法从设置中做到这一点,那么在你的htaccess文件中使用以下规则:
我有这个链接:
www.example.com/wp-content/themes/site/modules/library/?pid=55
我想将其重写为:
www.example.com/customName/55
我在.htaccess中尝试了很多东西,但都没有成功:
重写引擎打开重写Base/wp-content/themes/site/modules/library/?pid=1美元重写规则https://www.example.com/customName/1美元
RewriteEngine on
RewriteRule ^CustomName/([0-9]+)/?$ /wp-content/themes/site/modules/library/?pid=$1 [L,NC]
# other rules