Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

We have a site with categories and subcategories.

If anybody navigates to a content belongs to a subcategory the url will have the following form: domain/main-category/sub-category/mycontent/ But we need another form: domain/main-category/mycontent where mycontent belongs a subcategory inside main-category, but we don't want the subcategory to be displayed in the URL.

Is there any possible solution for this?

share|improve this question
add comment

2 Answers

If you go to Settings->Permalinks you should be able to set the tag/category base URL rules which should solve this problem.

Or, use some sort of plugin to do what you want. This one came up first on Google: http://wordpress.org/plugins/custom-permalinks/

share|improve this answer
    
Thank You! I'll try it! I hope, it will work. –  prohomepageHUN Jun 17 '13 at 8:38
add comment

You can rewrite you .htaccess if you are familiar with this.

Add the below line and try it:

RewriteRule ^category/(.+)$ http://www.site.com/$1 [R=301,L]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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