How can achieve this permalink perfectly? domain.com/%category%/%post-name%

enter image description here

I want to make a custom post URL like domain.com/%category%/%post-name% and I am able to do it but the problem is, the pages, posts showing 404.

I registered a custom post named download with array('slug' => '%download_category%', 'with_front' => false);

there is download_category associated with download post type.

This is the rewrite rule add_rewrite_rule( '^/(.*)/(.*)/?$', 'index.php?post_type=download&name=$matches[2]', 'top' );

And post link set correctly.

It is working fine. But the problem is, other pages show me 404. below is the screenshot with Query monitor request.

How can I solve it? Any help is appreciated.

Read more here:: How can achieve this permalink perfectly? domain.com/%category%/%post-name%

Leave a Reply

Your email address will not be published. Required fields are marked *