htaccess書き換えが使える
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^profile/(.*) /profile/?id=$1 [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
またはWordpress page_rewrite_rules:
このコード ブロックをテーマの functions.php ファイルに追加できます。
add_filter( 'page_rewrite_rules', 'my_page_rewrite_rules' );
function my_page_rewrite_rules( $rewrite_rules )
{
// The most generic page rewrite rule is at end of the array
// We place our rule one before that
end( $rewrite_rules );
$last_pattern = key( $rewrite_rules );
$last_replacement = array_pop( $rewrite_rules );
$rewrite_rules += array(
'profile/([0-9]+)/?$' => 'index.php?pagename=profile&id=$matches[1]',
$last_pattern => $last_replacement,
);
return $rewrite_rules;
}
ワードプレス コーデックス: http://codex.wordpress.org/Rewrite_API/add_rewrite_rule
ドキュメント: http://www.hongkiat.com/blog/wordpress-url-rewrite/