Support » Fixing WordPress » How to rewrite Category Permalink Structure

  • Resolved CapeCodBranding

    (@capecodbranding)


    I currently use the permalink structure ‘Day & Name” and I love it b/c it is very easy to ‘see’ what page you are on in my blog. I’d like to keep using that structure for my links. The problem is that Categories don’t work on my site. No matter which Category widget I use, it just yields a blank page (with header but no content). However, Categories do work if I use the Default Permalink structure.
    My category link structure is currently redirecting to this;

    http://capecodbranding.com/blog/category/how-to/

    How can I alter this so categories work? I noticed in “Control Panel > Settings > Permalinks” there is a place to override just the categories (or tags) link structure and I’ve been playing around but can’t find a solution that works.

    Any help would be appreciated!
    Thanks,
    amy

Viewing 15 replies - 1 through 15 (of 36 total)
  • From what I can see your link structure is like so http://capecodbranding.com/blog/posts/category/psychology/ which will then redirect you to the correct page. So /blog/ is the root, but not sure where /posts/ comes into the picture. Usually, if /blog/ is the root, your categories should come out /blog/category/psychology/. Just throwing this out so that you can figure out how /posts/ comes up in your url structure.

    Hi Parkstreet!

    Ok, so you made it farther than I did. I’m not sure how you found the link structure you did, but it goes where I want it to go…

    I’m not sure about the ‘posts’ part either (I’m very new to the permalink aspect of wordpress, I’ve never had to look at it before now).

    When I click on a category from my sidebar Cloud I get the permalink that I copied into my post above;

    http://capecodbranding.com/blog/category/apple/

    and it goes to a blank screen. Do you know how I can get my category widget to direct to the url that you found?

    Thanks!
    amy

    Your category archives are generating 500 Internal Server Errors. Make sure that the Category base is blank in your permalink settings, remove any category-specific rewrites you may have added to your .htaccess, and disable any rewrite or category-related plugins.

    I echo what @iridiax states above.

    Hi iridiax,

    I have deleted the one category widget I was using (WP-Cumulus), I don’t have anything in the Category base in the permalink settings and the only thing I have ever added to my .htaccess is a 301 redirect.
    I enabled the standard category widget that came with WP so I can still test my categories.
    When I click on one of my categories I’m still getting a blank white page (that has my header logo on it). Do you still see an Internal Errors message?

    Thanks for the help,
    amy

    the only thing I have ever added to my .htaccess is a 301 redirect.

    Try removing it. Set your permalinks to default. Rename your .htaccess (to disable it) and then regenerate your Day & Name permalinks to generate a fresh new .htaccess. Also check your root .htaccess for something that could be messing things up.

    500 Internal Server Errors are often caused by problems with a .htaccess file. Your category archives are still showing them.

    Can you tell me what plugins and widget you have active and are using?

    Hi Parkstreet,
    Sure can, there are quite a few…

    PlugIns;

    Add to Any
    Akismet
    All in One SEO
    Author Exposed
    Google Analytics for WordPress
    Similarity
    WordPress.com Popular Posts
    WordPress.com Stats
    WordPress.com Stats Helper
    WordPress Admin Bar
    WP-phpMyAdmin
    Wptouch iPhone Theme

    Since this morning I have deactivated WP-Cumulus and Collapsible Archive Widget (since I wasn’t sure if either were causing a problem).

    My Widgets are;

    Recent Posts
    Popular Posts
    Links
    Blog Stats (via WordPress.com Stats Helper)
    and the WordPress Categories widget that comes preinstalled

    Plus a few Text widgets with Adsense and Feedburner code in them.

    I’m trying to take iridaix’s advice and change my .htaccess to remove the 301 redirect I added. However that was almost a year ago and I don’t remember how I did it, so I’m looking for my htaccess file. I’m not very technical, so I apologize if my questions and problems are very basic. 🙂

    Thanks!
    amy

    No need to apologize. We all have to learn the ins and outs of the software we use, so we are all learning together. I don’t see any plugins or widgets that will give you the trouble you are having. Can you paste what you have in your .htaccess file?

    Thanks ParkStreet!

    I had to access my .htaccess file through my hosting company (iPower). I can’t remember if there is a way to see it from wordpress (and in my FTP the file is blank). Here is what I got from it;

    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^www.capecodbranding.com [nc]
    rewriterule ^(.*)$ http://capecodbranding.com/$1 [r=301,nc]

    This is the only thing I see when I open it… not sure if there is supposed to be more.

    Thanks, amy

    Is this the code that WordPress generated? I thought it would usually be something like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME}!-f
    RewriteCond %{REQUEST_FILENAME}!-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    You may need to change it to RewriteBase /blog/ since your blog is in a subdirectory.

    Also, I am seeing something that I haven’t see before.

    Warning: require(../reclamation/sidebar.php) [function.require]: failed to open stream: No such file or directory in /hermes/bosweb/web043/b431/ipw.theoccasionalcake/public_html/capecodbranding/blog/wp-content/themes/bluebird/category.php on line 5

    This appears when you go to http://capecodbranding.com/blog/category/apple/

    No, the 301 redirect is code that I entered into the .htaccess file manually last year. I googled to find the bit of code I’d need. I guess I didn’t realize I could have WP generate for me. Should I use the code you posted instead?

    Looks like I’ve made my problem worse. I’m not sure what I’ve done in the last couple hours to make my category pages display the error that they are…
    I followed the trail in the error (wp-content/themes/bluebird/category.php) however, I don’t have a category.php file in that theme (bluebird).

    Stumped. Still. 🙂

    You need some more troubleshooting:

    Rename the .htaccess files (to disable them) in your root and blog directory and see if categories work or not then. If they don’t, you can then rename these files back to .htaccess to reactivate them.

    Disable all plugins and see if categories work then or not.

    Switch to the default theme and see if the categories work then or not.

Viewing 15 replies - 1 through 15 (of 36 total)
  • The topic ‘How to rewrite Category Permalink Structure’ is closed to new replies.