I need to understand how to integrate a rewrite url so that I can get the same wording on a wordpress site:
xxxx.com/{$author_username}/{$id_post}
The purpose is to have a shortlink of a wordpress post and easily readable.
Can you tell me how I can do this?
Unfortunately there are now conflicts..
Thank you!!
To modify the structure of your slugs, you don't need to modify any core files in WordPress or add additional functions, you can simply modify the structure inside of WP > Settings > Permalinks.
Please note that if your server is blocking the edit of .htaccess
file then it will not work. An error notification should appear. In that case you will need to ask your hosting provider to unblock the .htaccess
file.
Your structure can be a custom one with %author%/%post_id%
as a value.
Reference: https://wordpress.org/support/article/settings-permalinks-screen/