Add static text to post URLs

I have 2 pages on my site which include blog posts (real site is pw protected):

https://example.com/blog/

https://example.com/news/

All blog and news articles should have a URL that begins with https://example.com/my-blog/.

Example: https://example.com/my-blog/this-is-the-article-name

So, what I need to do, is include my-blog in the URL before the post name. I've tried things with permalinks, but that didn't work. I'm really stumped and need help with this!

Thank you.

Topic url-rewriting posts Wordpress

Category Web


if i good understand your problem, you should to go:

Dashboard -> Settings -> Permalinks and in "Common Settings" section select checkbox "Custom Structure" and here paste:

/my-blog/%postname%/

and save changes. Now refresh your page and go to random post and your url should be like:

https://example.com/my-blog/this-is-the-article-name

Good luck!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.