WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] custom permalink + author = 404 (19 posts)

  1. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I have an annoying problem with the author links - they don't work unless I keep the permalink structure to the default.

    Ok, more specifically, I am on WP 2.8 (but it wasn't working on 2.7 either), if I set the custom permalink structure to any of the example ones (the radio buttons) or what I was using: /%category%/%postname%/
    I get a 404 error when navigating to author pages.

    The page it tries to reach is of this structure
    http://mydomain/author/JoeGregory/ and it returns a 404 error.

    All other permalinks seem to be working fine.
    My .htaccess looks 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

    I have searched the forums but I'm coming up blank, what do I need to do next to find the cause of the problem?

    Please help!
    Debs

  2. debsjenkins
    Member
    Posted 4 years ago #

    oops, one more thing, the author link to admin always works

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    Are you generating the author link using either...
    the_author_posts_link();
    or
    the_author_link();

    If the admin account is the one you're trying to view the author page for, you may find it's actually...

    http://yoursite/author/admin/

  4. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    yes, the admin link does work and is like you say (mysite/author/admin/), it's the other authors on my site that don't work - mysite/author/nameofauthor/ - they all produce a 404.
    Debs

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    Ok, but as i said before... :)

    How are you generating the links to the author pages?

  6. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I've installed a couple of different plugins that create user pages (I don't have the skill to do this myself, so use plugins), just in case it was the first plugin that didn't work - I have:

    1. members list - http://www.ternstyle.us/products/plugins/wordpress/wordpress-members-plugin - this creates http://publishingacademy.com/members/ - you can see that I have some "members" - when you click through to (for example) Joe Gregory you get a 404

    2. I also installed (to check if it was the previous plugin) - User Community - http://alkivia.org/plugins/community - which creates this page: http://publishingacademy.com/about/faculty-members/ - when you click to Joe Gregory again, you first get the user community part (which works) and then a link to the author profile, which doesn't work - gives a 404 (click on "View This Author's Posts")

    I'm sorry if I'm not telling you what you need to know, just point me in the right direction and I'll tell you more!

    Does that help?
    thanks a bunch
    Debs

  7. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I installed WP-Devel and have this extra info to share:

    query_vars (Array, 1 element)
    o
    author_name (String, 10 characters ) joegregory
    *
    query_string (String, 22 characters ) author_name=joegregory
    *
    request (String, 17 characters ) author/joegregory
    *
    matched_rule (String, 17 characters ) author/([^/]+)/?$
    *
    matched_query (String, 22 characters ) author_name=joegregory
    *
    did_permalink (Boolean) TRUE

    Which suggests the permalink thing is working? I think???? Which would mean it's further along the chain - perhaps in author.php?
    Debs

  8. debsjenkins
    Member
    Posted 4 years ago #

    I also changed the theme back to default and I still get the error

  9. Mark / t31os
    Moderator
    Posted 4 years ago #

    You don't need a plugin if you just want author pages that link to their posts..

    You can plonk an author.php in your theme then create the link to those pages using one of the 2 functions i mentioned previously.

    There's a sample shown on the codex page here.
    http://codex.wordpress.org/Author_Templates#Sample_Template_File

  10. debsjenkins
    Member
    Posted 4 years ago #

    Ok, I checked, and from the posts pages where the author link also appears (for example: http://publishingacademy.com/authors/get-book-ideas/creativity-what-about-textbooks-academic-books at the bottom)

    The code in the theme uses: the_author_posts_link();

    Does that help in diagnosing why the link doesn't work? Anything else I can tell you?

    thanks for trying to help me with this

  11. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I have also turned off plugins one by one to see if that fixed it and it didn't
    Debs

  12. Mark / t31os
    Moderator
    Posted 4 years ago #

    Can i see the code from the file you have the code placed in...

    Plonk it in a pastebin, then post the link here.
    http://wordpress.pastebin.com/

  13. debsjenkins
    Member
    Posted 4 years ago #

    thanks, I've done that

  14. debsjenkins
    Member
    Posted 4 years ago #

    oops, forgot to post the link
    http://wordpress.pastebin.com/m7360cf73

  15. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I just added a new user - and only used a firstname - that user's page works and does NOT create a 404 - but I can't work out why the other links don't work - it seems as if they should.
    Debs

  16. debsjenkins
    Member
    Posted 4 years ago #

    Hi
    I have worked out that the profile pages work IF the author's user_nicename in wp_users is changed to not include a space. So does anyone know of a fix for this, without me having to poke the database by hand for each user?
    Debs

  17. Mark / t31os
    Moderator
    Posted 4 years ago #

    Use hyphens in the user nicenames, then replace the hyphen with a space when you retrieve it.

    Is the code provided above from an author.php file or something else?

    I can write you something to do the replacement text with the names..

  18. immanence
    Member
    Posted 3 years ago #

    I'm sorry to jump in here, 11 months after this was resolved, but I don't find anything on my problem elsewhere, or perhaps I am simply too novice to express it.

    Basically, my theme puts my name as author when I post a blog entry. The problem is, if I click on that link, I get a 404 Error.

    I think the issue is because I have a space in my username, like John Doe. When the link is formed for the author it comes out like:

    http://mysite.com/author/John%20Doe/

    This then generates the 404 Error.

    I don't know how to resolve this. Can anyone who was involved in this thread help me?

    Many thanks

  19. Mark / t31os
    Moderator
    Posted 3 years ago #

    Your post won't get noticed on the end of a resolved topic, which is why i've only just now seen it, please repost your question as a new thread.

    Alongside that post, a link to the site in question would be helpful.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic