Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は現在ワードプレスに取り組んでいます。URL 0fサイトはこんな感じ
example.com/dashboard-form/?din=random12 .
こんなURLにしたい
example.com/dashboard-form/random。
前もって感謝します
初期化時に追加:
カスタム変数を登録するには (質問の「din」)
add_rewrite_tag('%mycustomvar%','([^&]+)');
書き換えルールを作成するには:
add_rewrite_rule('^product/([0-9]{1,})/?','index.php?p=4&mycustomvar=$matches[1]','top')
詳細については、以下のリンクを参照してください。
https://wordpress.stackexchange.com/questions/48487/how-to-retrieve-get-variables-from-rewritten-urls
書き換えルールを追加して、クエリがあれば教えてください。