WordPress.org

Ready to get started?Download WordPress

Forums

Permalink errors + .htaccess (6 posts)

  1. kiriska
    Member
    Posted 5 years ago #

    Before anyone asks, I did read over the recent thread with a similar title, but it doesn't seem to be the same problem.

    I have my blog installed in the /blog/ folder but have pages appearing in the index. Thus, in the General Settings, WP address is /blog/ and blog address is /. Additionally, my index page displays a static page ("home") and the WP blog is contained with a page called "blog", so /blog/ is also the main of the WP blog. I hope that's not ridiculously confusing.

    Since my WP blog entries are actually on /blog/, I've set my permalink structure as: /blog/%year%/%monthnum%/%postname%/

    This seems to work fine for me, but several site visitors have reported not being able to access the permalinks for an entry without first getting several errors. As in, they'll click the link, get an error, refresh, and then it'll be fine. I couldn't duplicate this on Firefox (3.0.10) or Chrome, but when I took it into IE 7, I got a 404 error on permalinks. Refresh and it's fine.

    Why aren't the permalinks working the first time around? And why does the error seem to be IE-specific?

    When I initially set up the site, I had trouble writing my .htaccess files from the admin interface. Even though it says changes are saved when I change permalink structures, they aren't really. I had to edit the .htaccess myself. In any case, the .htaccess file on the index reads:

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

    There's also an .htaccess file in /blog/ that I don't think I put there myself.. It contains:

    RewriteCond %{HTTP_HOST} ^blog.deadend-detour.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.blog.deadend-detour.com$
    RewriteRule ^.*$ "http\:\/\/www\.deadend\-detour\.com\/blog\/" [R=301,L]

  2. kiriska
    Member
    Posted 5 years ago #

    Bump.

  3. nazcar
    Member
    Posted 5 years ago #

    /blog/%year%/%monthnum%/%postname%/

    try this:

    /blog/%year%/%monthnum%/%postname%

    remove the last backslash.
    hope it works.

  4. kiriska
    Member
    Posted 5 years ago #

    Bizarre. Removing the last backslash seems to help the permalinks for the blog post, but screws up the permalinks for the pages in the same manner as before.

  5. Shane G
    Member
    Posted 5 years ago #

    Hi,

    Add this code in htaccess:

    # BEGIN WordPress

    <IfModule mod_rewrite.c>
    ErrorDocument 404 /index.php?error=404
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Thanks,

    Shane G.

  6. kiriska
    Member
    Posted 5 years ago #

    Doesn't seem to have an effect. Permalinks for the blog still hit a 404 error initially about 50% of the time on IE. No issues on Firefox or Chrome.

Topic Closed

This topic has been closed to new replies.

About this Topic