Support » Fixing WordPress » stop using “category” in category permalinks

  • nolageek

    (@nolageek)


    I see that wordpress defaults to using category as the base for category archives (www.domain.com/category/category-name/sub-category-name) and if you enter anything into the Category-Base field it will use this instead. I would just likst to use a format of http://www.domain.com/category-name/sub-category-name. It seems like if there’s nothing there, it shouldn’t use anything – and just have %category% there as a default. To have ‘category’ in my url seems reduntant and needlessly long.
    Is there a hack or a modification I can make to remove this? I’m assuming there is someting that can be done in the htaccess – but I am notorious for screwing up mod rewrite? 🙂 I wanted to ask first.
    Could I just remove all of the ‘/category'</em?>s out of this part?
    RewriteRule ^category/(.+)/(feed|rdf|rss|rss2|atom)/?$ /wordpress/index.php?category_name=$1&feed=$2 [QSA,L]
    RewriteRule ^category/(.+)/page/?([0-9]{1,})/?$ /wordpress/index.php?category_name=$1&paged=$2 [QSA,L]
    RewriteRule ^category/(.+)/?$ /wordpress/index.php?category_name=$1 [QSA,L]

    But that’s not going to stop the internal links from being messed up. 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • Joerg

    (@joerg)

    I´m a friend of clean and short urls too. I wish there will be a option to use “/category/” or not. I take a look in wp1.3 and try to change the rules. i had found a solution for me modifying the url-generation without “/category/”. and i put the category-rule till the end of .htaccess. Thats work fine for me.
    But i also know thats a tricky solution and not the future. thats why I wait to post it here.
    I think a solution is a pattern in the admin-permalink-screen.
    If you use one pattern like “//” or “%%” etc. you would have the possibility to generate the url without the “/category/”. Otherwise not. I wish to have more flexibility.
    Please don´t beat me, i don´t know the correct pattern. You can change my example.
    What are you think about it?
    PS: And hey, let me say here: I´m very glad to see the new url-generation in wp1.3. realy nice!

    dss

    (@dss)

    looks like someone didn’t close up their tag up there…
    tich-tich

    navid

    (@navid)

    The problem with not using dates with permalinks is that you often times create duplicate titles (or post-slugs) for sometimes very different posts.
    If you are using dates (down to the day-level), this will generally never happen. Moreover, if you are looking to create a static-looking post, you should use “pages” which are new in WordPress 1.3.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘stop using “category” in category permalinks’ is closed to new replies.