Viewing 9 replies - 1 through 9 (of 9 total)
  • Novac

    (@novac)

    I also am interested in some info on setting up my blog so that [blogdir]/category/ will show a list of the categories instead of a 404.

    Thread Starter paolino

    (@paolino)

    No one who want (or can) help me and Novac?

    It seems that the rules WP generates doesn’t take into account this feature. Add this to the end of your .htaccess file:

    RewriteRule ^category/$ /index.php?cat=0 [QSA,L]

    I’ve tested it working on my website: https://markashields.com/category/

    Of course, https://markashields.com/category will not working because it’s missing the slash. If you want that to work as well, add:
    RewriteRule ^category$ /index.php?cat=0 [QSA,L]

    Note, this will not show a list of categories. It shows all posts in all categories.

    Novac

    (@novac)

    Thanks. That’s a perfect starting point!

    Thread Starter paolino

    (@paolino)

    Thanks Mark, I think it’s a good starting point. But there are some problems.
    I rewrite your rule according to my site settings. Now if i do
    [blogdir]/category/ I’ don’t have anymore the [in]famous 404 error but it reloads the starting page. I’m sure becouse in my theme directory I have category.php and this file is loaded when a category is hitted. It works perfectly with all the other category but not with your solution.
    So I tried the following rules:
    RewriteRule ^category$ /index.php?cat=1 [QSA,L]
    With cat=1 (without “$” sign) it load correctly the category.php template. If I try with a non existing category id (let’s say 56) I have the 404 error (different from the original one, this one is styled inside my blog and it’s not the apache default 404 page).

    So it seemd that cat=0 doesn’t call correctly the right template (in order category.php, archive,php, index.php) but it calls directly index.php as template.

    I think we are not so far from the solution… but we have to investigate more. 8-)) LOL

    Thank you

    Thread Starter paolino

    (@paolino)

    I’ve investigate further and I really think that index.php?cat=0 is completely diferent from index.php?cat=1 (or any othe number).
    Both category.php and archive.php doesn’t apply fat index.php?cat=0

    Bug or feature?

    Thread Starter paolino

    (@paolino)

    No one can confirm my investigation?

    Moderator James Huff

    (@macmanx)

    index.php?cat=0 takes me back to my index page. This is logical, because WordPress will not create a category with an id of 0. You cannot go directly to /category/ because it is a virtual directory. It needs a category name to be directed to, ex: /category/name/.

    Thread Starter paolino

    (@paolino)

    IMHO cat=0 means all the category. In this way /category/ shoud point to “category.php”. In category.php it easy to check the ID and showing all the category.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘1.5 permalink trouble: www.mysite.com/category/’ is closed to new replies.