I'd like to create a permalink structure that works in the following way:
Pages - http://myurl.com/pagename
Posts - http://myurl.com/news/postname/
How would I do so?
Thank you
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI'd like to create a permalink structure that works in the following way:
Pages - http://myurl.com/pagename
Posts - http://myurl.com/news/postname/
How would I do so?
Thank you
Go to "Settings" -> "Permalink" page and set custom structure for permalinks equals to /news/%postname%
.
When adding something like /news/%postname% to the permalink structure (you have to select "Custom" Permalink structure), I always think about how my users would "trust" this structure.
Most people are familiar with .html at the end, so I used to add this
/%postname%.html - for my regular posts
If you want something before that simply add it like suggested above
/news/%postname%.html - however that would appear on all posts.
You should consider to modify the Category base, it's on the same page yourdomain.com/wp-admin/options-permalink.php under Optional - by default it would show you /category/category-name on the frontend, so you can remove the /category/ from the URL there to get http://myurl.com/news/postname/ (you would then have to create a category "news" after changing the Category base)