我目前正致力于wordpress。 URL 0f site就是这样的
example.com/dashboard-form/?din=random12 即可。
我希望网址像这样
example.com/dashboard-form/random 即可。
提前致谢
答案 0 :(得分:1)
要在init上添加:
注册自定义变量(问题中的'din')
add_rewrite_tag('%mycustomvar%','([^&]+)');
创建重写规则:
add_rewrite_rule('^product/([0-9]{1,})/?','index.php?p=4&mycustomvar=$matches[1]','top')
有关详情,请参阅以下链接:
尝试添加重写规则,如果有任何查询,请告诉我。