Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Permalink for categories ONLY, leave the rest intact WordPress

  • SOLVED

Hello all,

I have a problem: I’d like to create custom permalink for the categories but leave the rest intact. For example:

mysite.com/?cat=1 will be mysite.com/house
mysite.com/?cat=3 will be mysite.com/lands

AND the rest stays intact:

mysite.com/?p=123
mysite.com/?page_id=96

I tried some htaccess rewrite tutorials but no success yet…

Thanks!

Answers (2)

2010-12-16

Dan | gteh answers:

Have you tried this plugin? http://wordpress.org/extend/plugins/advanced-permalinks

I haven't used it yet but it looks like it may let you customize permalinks for each type of link and possibly let you keep all others in standard format.


urbanoid comments:

I tried a few but not this one... I'm giving it a shot!


urbanoid comments:

Ok, it's almost working, the last thing: it gives 404 error if I click on mysite.com/houses . It's like wordpress doesn't handle or doesn't understand that this should be a category page.


Dan | gteh comments:

Out of curiosity, try manually adding /category to that and see if it works.

mysite.com/category/houses


urbanoid comments:

404. Probably I should trick with htaccess to display mysite.com/?cat=1 page if request is mysite.com/houses


urbanoid comments:

The plugin and this .htaccess code solved the problem:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^houses$ ?cat=1 [L]
RewriteRule ^terras$ ?cat=3 [L]

Thanks for pointing me in the right direction.

2010-12-16

Pali Madra answers:

Hello
I wanted to find out if each category has multiple posts or each category has one post only.

[[LINK href="http://codex.wordpress.org/Using_Permalinks"]]WordPress codex[[/LINK]] does not recommend using category as the base for permalinks. See the section on structure.

Is it possible to use tags for permalinks so that the need for using category is circumvented. I understand that this would not be possible if you already have the site up with lots of content.

Once I have the answers to above I will try and find a solution.