0

I have a regular business website that I built on Wordpress - www.example.com

I have a blog page in my website under - www.example.com/blog

When viewing a blog post it looks like this: www.exmaple.com/[category]/[posts-name]

How can I add "/blog" to this URL before the category? like this: www.exmaple.com/blog/[category]/[posts-name]

This is my current .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

2 Answers 2

1

You can not do that viw .htaccess because .htacces rules can not control how the permalinks are generated by WordPress. Instead, go to WordPress settings->permalink. Select custom structure and enter:

blog/%category%/%postname%
3
  • I already have /%category%/%postname%/ there. I think that will change my homepage URL to www.example.com/blog, which I don't want to happen.
    – Kar19
    Commented Apr 27, 2015 at 10:20
  • Actually worked! Now I don't think I understand enough how all the permalinks work on WP :/ Do you have a tutorial that exmplane exactly how the permalinks work on WP ?
    – Kar19
    Commented Apr 27, 2015 at 10:23
  • The configuration in settings->permalink is for posts, tags and categories. The URL for site is configured in settings->general. About a tutorial, I don't remember any one but you can start with Using permalinks entry in the codex. Further modificacions may need the use of the_permalink filter and Rewrite API.
    – cybmeta
    Commented Apr 27, 2015 at 11:01
0

Go to Settings -> Permalink and type in Custom structure.

/blog/%postname%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.