WordPress.org

Ready to get started?Download WordPress

Forums

Strange Permalink Problem (6 posts)

  1. cashplanet
    Member
    Posted 7 years ago #

    I recently decided to use custom permalinks
    using this structure: /%postname%/

    I put this code in the .htaccess file which
    is located in the blog folder:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php
    </IfModule>

    Everything is working fine apart from one strange
    problem which only effects a few of my posts.

    The problem occurs when I use either the word
    "blog" or "blogging" in the slug link.

    If I use either of these words in the slug link it
    displays fine on the main page but is not found on
    the single page for the post.

    Its strange because if I delete the word "blog" or
    "blogging" from the slug link the problem is fixed
    and everything works fine for the single post page.

    I need to use these words in the slug link for a
    few posts otherwise I would just rename it.

    Any help and ideas to solve this problem are welcome.

    Thanks,
    Simon

  2. ccoupe
    Member
    Posted 7 years ago #

    Nice description of the problem and your attempted solutions, cashplanet. If all were so easy to see.. sigh.

    I suspect its a nasty side effect of the Rewritebase /blog/

    Try removing that trailing slash on the RewriteBase.

  3. cashplanet
    Member
    Posted 7 years ago #

    Thanks for the reply ccoupe but removing the slash
    on the end of /blog/ didn't sort out the problem.

    If you have any other ideas I would like to
    hear them as I don't know what else to do.

  4. moshu
    Member
    Posted 7 years ago #

    I need to use these words in the slug link for a
    few posts otherwise I would just rename it.

    Then rename the folder :)

  5. ccoupe
    Member
    Posted 7 years ago #

    Looking at the problem again with fresher eyes, there is still some .htaccess things I'm not sure about. I suspect the ordering of the rules is a problem but I'm far from an expert on the subject. Google up your version of Apache's documentation.

    I'd debug it by putting the WordPress settings back to default/ugly and delete the contents of .htaccess. Make sure you can get to the front page and the categories and archives. Then set your new permalink format.

    Finding and using the error log would help if you start running into 304 and 5XX errors.

  6. cashplanet
    Member
    Posted 7 years ago #

    I have decided that rather than mess around with my
    blog and risk making the problem worse I will just
    avoid using the words "blog" or "blogging" in the
    titles of my posts in future.

    Thanks for all your help "ccoupe" and "moshu",
    I really appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Topic