WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Pretty Permalink trouble

[Resolved] Pretty Permalink trouble

  • Hi,
    I’m using WordPress on an Ubuntu/Apache/MySQL/PHP server. For the “Pretty Permalinks,” it uses mod_rewrite. However, it shows a 404 error when one of these links is visited.

    WordPress generated its own .htaccess file, so it should be correct, but I’ll post it anyway:

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

    It should turn /enl/?p=123 into /enl/categories/post-name but it isn’t doing anything. I even tried restarting the server, but still nothing.

    I’m sure that mod_rewrite is enabled; it shows up in phpinfo() under apache2handler Loaded Modules.

    Any help is much appreciated.
    Thanks a lot in advance,
    –Richard

Viewing 8 replies - 1 through 8 (of 8 total)
  • I use Godaddy and when I set pretty permalinks it takes about an hour or so before the links stop giving a 404 error. Something about it taking a while for the .htaccess changes to take effect. Might be the same in your case. Give it an hour an see what happens.

    Thanks for your reply, thisisedie, but I’ve been having this problem since yesterday. About 18 hours. So I don’t think waiting is the answer. Also, it’s my own server, and I restarted it, so that should update everything shouldn’t it?

    There may be an error in the permalink format you are using. It should be:

    /%category%/%postname%/

    /%category%/%postname%/ is the exact permalink structure I’m using. I really can’t think what I’m doing wrong.

    I installed the AskApache RewriteRules Viewer, and it tells me the following…

    > Permalink: /%category%/%postname%/
    > Writable .htaccess file found
    > mod_rewrite found
    > Not using pathinfo style index permalinks
    > Using mod_rewrite permalinks

    …which all sounds fine to me, but it still doesn’t work.

    Does anybody have any ideas? I feel like I’ve tried everything, and I don’t want to have to settle for /?p=123

    Thanks
    –Richard

    Solved.
    The problem was in the apache2.conf file.
    All my directories were set to AllowOverride None.
    After changing them to AllowOverride All, I got a 500 Internal Server Error. So I messed around with the .conf files, and I finally discovered that it was the .htaccess files causing the error, not the .conf files.
    Deleting the .htaccess files removed the 500 Error. Then I went back to wp-admin and had WordPress generate a fresh .htaccess, and everything now works perfectly.

    # Edit #
    iridiax – I had the browser window open for a while, and I didn’t refresh before posting this reply. It’s a shame I didn’t see your link, it lists AllowOverride All in the requirements. Still, thanks a lot for trying to help.

    Yeah this sucks for me because I am hosted by Godaddy and only they can change it. I called them and asked if they could check it out but they said AllowOverride was active. However I am not sure thats the case.

    Would you mind posting what your new .htaccess file looks like? I am curious to see what it changed based on your old file above.

    Thanks finkyfeke

    My .htaccess looks pretty much the same:

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Pretty Permalink trouble’ is closed to new replies.
Skip to toolbar